diff --git a/.github/workflows/build_bench.yml b/.github/workflows/build_bench.yml index 20aba1f3..772c56ee 100644 --- a/.github/workflows/build_bench.yml +++ b/.github/workflows/build_bench.yml @@ -38,7 +38,7 @@ jobs: run: echo "LATEST_BENCH_RELEASE=$(curl -s 'https://api.github.com/repos/frappe/bench/releases/latest' | jq -r '.tag_name')" >> "$GITHUB_ENV" - name: Build and test - uses: docker/bake-action@v6.3.0 + uses: docker/bake-action@v6.6.0 with: source: . targets: bench-test @@ -52,7 +52,7 @@ jobs: - name: Push if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} - uses: docker/bake-action@v6.3.0 + uses: docker/bake-action@v6.6.0 with: targets: bench push: true diff --git a/.github/workflows/build_stable.yml b/.github/workflows/build_stable.yml index 3566b2ba..f24960ba 100644 --- a/.github/workflows/build_stable.yml +++ b/.github/workflows/build_stable.yml @@ -100,7 +100,7 @@ jobs: steps: - name: Setup deploy key - uses: webfactory/ssh-agent@v0.8.0 + uses: webfactory/ssh-agent@v0.9.1 with: ssh-private-key: ${{ secrets.HELM_DEPLOY_KEY }} diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index ae4b1ece..90415dfd 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest services: registry: - image: registry:2 + image: docker.io/registry:2 ports: - 5000:5000 strategy: @@ -45,8 +45,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up QEMU + - name: Setup QEMU uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: all - name: Setup Buildx uses: docker/setup-buildx-action@v3 @@ -63,7 +66,7 @@ jobs: echo "NODE_VERSION=${{ inputs.node_version }}" >> "$GITHUB_ENV" - name: Build - uses: docker/bake-action@v6.3.0 + uses: docker/bake-action@v6.6.0 with: source: . push: true @@ -92,6 +95,7 @@ jobs: - name: Push if: ${{ inputs.push }} - uses: docker/bake-action@v6.3.0 + uses: docker/bake-action@v6.6.0 with: push: true + set: "*.platform=linux/amd64,linux/arm64" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11aa7e45..5a1d6036 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: black - repo: https://github.com/pycqa/isort - rev: 6.0.0 + rev: 6.0.1 hooks: - id: isort @@ -27,6 +27,8 @@ repos: rev: v4.0.0-alpha.8 hooks: - id: prettier + additional_dependencies: + - prettier@3.5.2 - repo: https://github.com/codespell-project/codespell rev: v2.4.1 diff --git a/README.md b/README.md index 269db059..39f843eb 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ After cloning the repo run this command to build multi-architecture images speci and then -- add `platform: linux/arm64` to all services in the pwd.yaml +- add `platform: linux/arm64` to all services in the `pwd.yml` - replace the current specified versions of erpnext image on `pwd.yml` with `:latest` Then run: `docker compose -f pwd.yml up -d` diff --git a/development/installer.py b/development/installer.py index f977b822..edd62147 100755 --- a/development/installer.py +++ b/development/installer.py @@ -207,6 +207,7 @@ def create_site_in_bench(args): new_site_cmd = [ "bench", "new-site", + f"--db-root-username=root", f"--db-host=mariadb", # Should match the compose service name f"--db-type={args.db_type}", # Add the selected database type f"--mariadb-user-host-login-scope=%", @@ -222,6 +223,7 @@ def create_site_in_bench(args): new_site_cmd = [ "bench", "new-site", + f"--db-root-username=root", f"--db-host=postgresql", # Should match the compose service name f"--db-type={args.db_type}", # Add the selected database type f"--db-root-password=123", # Replace with your PostgreSQL password diff --git a/development/vscode-example/launch.json b/development/vscode-example/launch.json index e3100c7a..46c886a4 100644 --- a/development/vscode-example/launch.json +++ b/development/vscode-example/launch.json @@ -6,7 +6,7 @@ "configurations": [ { "name": "Bench Web", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", "args": [ @@ -17,7 +17,6 @@ "--noreload", "--nothreading" ], - "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -25,11 +24,10 @@ }, { "name": "Bench Short Worker", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", "args": ["frappe", "worker", "--queue", "short"], - "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -37,11 +35,10 @@ }, { "name": "Bench Long Worker", - "type": "python", + "type": "debugpy", "request": "launch", "program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", "args": ["frappe", "worker", "--queue", "long"], - "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -49,21 +46,21 @@ }, { "name": "Honcho SocketIO Watch Schedule Worker", - "type": "python", + "type": "debugpy", "request": "launch", + "python": "/home/frappe/.pyenv/shims/python", "program": "/home/frappe/.local/bin/honcho", - "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench", "console": "internalConsole", - "args": [ - "start", - "socketio", - "watch", - "schedule", - "worker_short", - "worker_long", - "worker_default" - ] + "args": ["start", "socketio", "watch", "schedule", "worker"], + "postDebugTask": "Clean Honcho SocketIO Watch Schedule Worker" + } + ], + "compounds": [ + { + "name": "Honcho + Web debug", + "configurations": ["Bench Web", "Honcho SocketIO Watch Schedule Worker"], + "stopAll": true } ] } diff --git a/development/vscode-example/tasks.json b/development/vscode-example/tasks.json new file mode 100644 index 00000000..7c0e6739 --- /dev/null +++ b/development/vscode-example/tasks.json @@ -0,0 +1,22 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Clean Honcho SocketIO Watch Schedule Worker", + "detail": "When stopping the debug process from vscode window, the honcho won't receive the SIGINT signal. This task will send the SIGINT signal to the honcho processes.", + "type": "shell", + "command": "pkill -SIGINT -f bench; pkill -SIGINT -f socketio", + "isBackground": false, + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "close": true + } + } + ] +} diff --git a/docs/development.md b/docs/development.md index 1d862231..8bdeb4f8 100644 --- a/docs/development.md +++ b/docs/development.md @@ -221,6 +221,11 @@ bench --site development.localhost install-app erpnext ``` Note: Both frappe and erpnext must be on branch with same name. e.g. version-14 +You can use the `switch-to-branch` command to align versions if you get an error about mismatching versions. + +```shell +bench switch-to-branch version-xx +``` ### Start Frappe without debugging diff --git a/docs/site-operations.md b/docs/site-operations.md index 08f1f159..550d9bdf 100644 --- a/docs/site-operations.md +++ b/docs/site-operations.md @@ -7,6 +7,7 @@ Note: - Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds. +- Also you have to pass `-p ` if `-p` passed previously eg. `docker-compose -p exec (rest of the command)`. ```sh docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-root-password --admin-password diff --git a/example.env b/example.env index 7b0b4d1c..3902f223 100644 --- a/example.env +++ b/example.env @@ -1,6 +1,6 @@ # Reference: https://github.com/frappe/frappe_docker/blob/main/docs/environment-variables.md -ERPNEXT_VERSION=v15.53.0 +ERPNEXT_VERSION=v15.61.0 DB_PASSWORD=123 diff --git a/images/bench/Dockerfile b/images/bench/Dockerfile index 8281e255..ba7641cf 100644 --- a/images/bench/Dockerfile +++ b/images/bench/Dockerfile @@ -47,6 +47,7 @@ RUN apt-get update \ libsasl2-dev \ libtiff5-dev \ libwebp-dev \ + pkg-config \ redis-tools \ rlwrap \ tk8.6-dev \ diff --git a/images/custom/Containerfile b/images/custom/Containerfile index a35b93fe..ff02845b 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -94,6 +94,7 @@ RUN apt-get update \ libsasl2-dev \ libtiff5-dev \ libwebp-dev \ + pkg-config \ redis-tools \ rlwrap \ tk8.6-dev \ diff --git a/images/production/Containerfile b/images/production/Containerfile index 78c80f73..69d7250e 100644 --- a/images/production/Containerfile +++ b/images/production/Containerfile @@ -86,6 +86,7 @@ RUN apt-get update \ libsasl2-dev \ libtiff5-dev \ libwebp-dev \ + pkg-config \ redis-tools \ rlwrap \ tk8.6-dev \ @@ -121,7 +122,7 @@ FROM base AS erpnext USER frappe -RUN echo "echo \"Commands restricted in prodution container, Read FAQ before you proceed: https://frappe.fyi/ctr-faq\"" >> ~/.bashrc +RUN echo "echo \"Commands restricted in prodution container, Read FAQ before you proceed: https://frappe.io/ctr-faq\"" >> ~/.bashrc COPY --from=builder --chown=frappe:frappe /home/frappe/frappe-bench /home/frappe/frappe-bench diff --git a/pwd.yml b/pwd.yml index cba28a30..b3d41cac 100644 --- a/pwd.yml +++ b/pwd.yml @@ -2,8 +2,7 @@ version: "3" services: backend: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -19,8 +18,7 @@ services: MARIADB_ROOT_PASSWORD: admin configurator: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -49,8 +47,7 @@ services: - logs:/home/frappe/frappe-bench/logs create-site: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -105,8 +102,7 @@ services: - db-data:/var/lib/mysql frontend: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network depends_on: @@ -132,8 +128,7 @@ services: - "8080:8080" queue-long: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -149,8 +144,7 @@ services: - logs:/home/frappe/frappe-bench/logs queue-short: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -184,8 +178,7 @@ services: condition: on-failure scheduler: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: @@ -199,8 +192,7 @@ services: - logs:/home/frappe/frappe-bench/logs websocket: - image: frappe/erpnext:v15.53.0 - platform: linux/amd64 + image: frappe/erpnext:v15.61.0 networks: - frappe_network deploy: diff --git a/requirements-test.txt b/requirements-test.txt index d197ada2..2c78728c 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1 +1 @@ -pytest==8.3.4 +pytest==8.3.5