Merge branch 'main' into main

This commit is contained in:
Xiaoming Wang 2025-05-15 03:15:48 +01:00 committed by GitHub
commit d4e9909580
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 73 additions and 45 deletions

View file

@ -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

View file

@ -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 }}

View file

@ -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"

View file

@ -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

View file

@ -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`

View file

@ -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

View file

@ -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
}
]
}

View file

@ -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
}
}
]
}

View file

@ -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

View file

@ -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 <project_name>` if `-p` passed previously eg. `docker-compose -p <project_name> exec (rest of the command)`.
```sh
docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-root-password <db-password> --admin-password <admin-password> <site-name>

View file

@ -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

View file

@ -47,6 +47,7 @@ RUN apt-get update \
libsasl2-dev \
libtiff5-dev \
libwebp-dev \
pkg-config \
redis-tools \
rlwrap \
tk8.6-dev \

View file

@ -94,6 +94,7 @@ RUN apt-get update \
libsasl2-dev \
libtiff5-dev \
libwebp-dev \
pkg-config \
redis-tools \
rlwrap \
tk8.6-dev \

View file

@ -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

24
pwd.yml
View file

@ -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:

View file

@ -1 +1 @@
pytest==8.3.4
pytest==8.3.5