Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/generate-image-names/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ runs:
if [ "$aliyun_credentials" != "{}" ] && [ "$aliyun_credentials" != "" ] && [ "$aliyun_credentials" != "null" ]; then
# Parse Aliyun credentials
registry=$(echo "$aliyun_credentials" | jq -r '.registry')
acr_image_name="${registry}/${{ fromJson(inputs.aliyun_credentials).username }}/devbox/${image_name}:${tag}"
namespace=$(echo "$aliyun_credentials" | jq -r '.namespace')
acr_image_name="${registry}/${namespace}/devbox/${image_name}:${tag}"
else
acr_image_name=""
fi
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-framework-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ jobs:
dockerfile: ${{ matrix.framework_packages.dockerfile }}
tag: ${{ needs.define-matrix.outputs.tag }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push standard images (standard)
uses: ./.github/actions/build-and-push
with:
dockerfile: ${{ matrix.framework_packages.dockerfile }}
build_base_image: ${{ matrix.framework_packages.base_image }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
ghcr_image_name: ${{ steps.generate-standard.outputs.ghcr_image_name }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
acr_image_name: ${{ steps.generate-standard.outputs.acr_image_name }}
- name: Generate image names (cn-patched)
id: generate-cn
Expand All @@ -132,7 +132,7 @@ jobs:
dockerfile: ${{ matrix.framework_packages.dockerfile }}
tag: ${{ needs.define-matrix.outputs.tag_cn }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push cn-patched images (cn-patched)
if: ${{ needs.define-matrix.outputs.cn_patch_enabled == 'true' }}
uses: ./.github/actions/build-and-push
Expand All @@ -141,6 +141,6 @@ jobs:
build_base_image: ${{ matrix.framework_packages.base_image_with_cn_patch }}
build_args: CN_PATCH_ENABLED=true
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
ghcr_image_name: ${{ steps.generate-cn.outputs.ghcr_image_name }}
acr_image_name: ${{ steps.generate-cn.outputs.acr_image_name }}
8 changes: 4 additions & 4 deletions .github/workflows/build-language-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ jobs:
dockerfile: ${{ matrix.language_packages }}
tag: ${{ needs.define-matrix.outputs.tag }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push standard images (standard)
uses: ./.github/actions/build-and-push
with:
dockerfile: ${{ matrix.language_packages }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
ghcr_image_name: ${{ steps.generate-standard.outputs.ghcr_image_name }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
acr_image_name: ${{ steps.generate-standard.outputs.acr_image_name }}
build_base_image: ${{ needs.define-matrix.outputs.build_base_image }}
- name: Generate image names (cn-patched)
Expand All @@ -131,7 +131,7 @@ jobs:
dockerfile: ${{ matrix.language_packages }}
tag: ${{ needs.define-matrix.outputs.tag_cn }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push cn-patched images (cn-patched)
if: ${{ needs.define-matrix.outputs.cn_patch_enabled == 'true' }}
uses: ./.github/actions/build-and-push
Expand All @@ -140,6 +140,6 @@ jobs:
build_args: CN_PATCH_ENABLED=true
build_base_image: ${{ needs.define-matrix.outputs.build_base_image_with_cn_patch }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
ghcr_image_name: ${{ steps.generate-cn.outputs.ghcr_image_name }}
acr_image_name: ${{ steps.generate-cn.outputs.acr_image_name }}
8 changes: 4 additions & 4 deletions .github/workflows/build-os-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ jobs:
dockerfile: ${{ matrix.os_packages }}
tag: ${{ needs.define-matrix.outputs.tag }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push standard images
uses: ./.github/actions/build-and-push
with:
dockerfile: ${{ matrix.os_packages }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
ghcr_image_name: ${{ steps.generate-standard.outputs.ghcr_image_name }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
acr_image_name: ${{ steps.generate-standard.outputs.acr_image_name }}
- name: Generate image names (cn-patched)
id: generate-cn
Expand All @@ -102,7 +102,7 @@ jobs:
dockerfile: ${{ matrix.os_packages }}
tag: ${{ needs.define-matrix.outputs.tag_cn }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
- name: Build and push cn-patched images
if: ${{ needs.define-matrix.outputs.cn_patch_enabled == 'true' }}
uses: ./.github/actions/build-and-push
Expand All @@ -112,4 +112,4 @@ jobs:
ghcr_image_name: ${{ steps.generate-cn.outputs.ghcr_image_name }}
ghcr_credentials: ${{ format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', 'ghcr.io', github.repository_owner, secrets.GITHUB_TOKEN) || '{}' }}
acr_image_name: ${{ steps.generate-cn.outputs.acr_image_name }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD) || '{}' }}
aliyun_credentials: ${{ inputs.aliyun_enabled == 'true' && format('{{"registry":"{0}","username":"{1}","password":"{2}", "namespace":"{3}"}}', secrets.ALIYUN_REGISTRY, secrets.ALIYUN_USERNAME, secrets.ALIYUN_PASSWORD, secrets.ALIYUN_NAMESPACE) || '{}' }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ bin
*.log

# IDE 文件
.vscode/
.idea/
*.swp
*.swo
14 changes: 14 additions & 0 deletions runtimes/frameworks/django/4.2.16/project/.vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.linux": {
"VIRTUAL_ENV": "${workspaceFolder}/venv"
},
"terminal.integrated.profiles.linux": {
"Python Venv": {
"path": "/bin/bash",
"args": ["-c", "source ${workspaceFolder}/bin/activate && exec bash"]
}
},
"terminal.integrated.defaultProfile.linux": "Python Venv"
}
14 changes: 14 additions & 0 deletions runtimes/frameworks/flask/3.0.3/project/.vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.linux": {
"VIRTUAL_ENV": "${workspaceFolder}/venv"
},
"terminal.integrated.profiles.linux": {
"Python Venv": {
"path": "/bin/bash",
"args": ["-c", "source ${workspaceFolder}/bin/activate && exec bash"]
}
},
"terminal.integrated.defaultProfile.linux": "Python Venv"
}
14 changes: 14 additions & 0 deletions runtimes/languages/python/3.10/project/.vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.linux": {
"VIRTUAL_ENV": "${workspaceFolder}/venv"
},
"terminal.integrated.profiles.linux": {
"Python Venv": {
"path": "/bin/bash",
"args": ["-c", "source ${workspaceFolder}/bin/activate && exec bash"]
}
},
"terminal.integrated.defaultProfile.linux": "Python Venv"
}
30 changes: 28 additions & 2 deletions runtimes/languages/python/3.10/project/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
#!/bin/bash
. bin/activate
python3 hello.py

app_env=${1:-development}

# Prefer activating Python virtual environment if present
if [ -f "bin/activate" ]; then
. bin/activate
fi

# Development environment commands
dev_commands() {
echo "Running development environment commands..."
python3 hello.py
}

# Production environment commands
prod_commands() {
echo "Running production environment commands..."
python3 hello.py
}

# Decide environment based on argument
if [ "$app_env" = "production" ] || [ "$app_env" = "prod" ] ; then
echo "Production environment detected"
prod_commands
else
echo "Development environment detected"
dev_commands
fi
14 changes: 14 additions & 0 deletions runtimes/languages/python/3.11/project/.vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.linux": {
"VIRTUAL_ENV": "${workspaceFolder}/venv"
},
"terminal.integrated.profiles.linux": {
"Python Venv": {
"path": "/bin/bash",
"args": ["-c", "source ${workspaceFolder}/bin/activate && exec bash"]
}
},
"terminal.integrated.defaultProfile.linux": "Python Venv"
}
30 changes: 28 additions & 2 deletions runtimes/languages/python/3.11/project/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
#!/bin/bash
. bin/activate
python3 hello.py

app_env=${1:-development}

# Prefer activating Python virtual environment if present
if [ -f "bin/activate" ]; then
. bin/activate
fi

# Development environment commands
dev_commands() {
echo "Running development environment commands..."
python3 hello.py
}

# Production environment commands
prod_commands() {
echo "Running production environment commands..."
python3 hello.py
}

# Decide environment based on argument
if [ "$app_env" = "production" ] || [ "$app_env" = "prod" ] ; then
echo "Production environment detected"
prod_commands
else
echo "Development environment detected"
dev_commands
fi
14 changes: 14 additions & 0 deletions runtimes/languages/python/3.12/project/.vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.linux": {
"VIRTUAL_ENV": "${workspaceFolder}/venv"
},
"terminal.integrated.profiles.linux": {
"Python Venv": {
"path": "/bin/bash",
"args": ["-c", "source ${workspaceFolder}/bin/activate && exec bash"]
}
},
"terminal.integrated.defaultProfile.linux": "Python Venv"
}
30 changes: 28 additions & 2 deletions runtimes/languages/python/3.12/project/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
#!/bin/bash
. bin/activate
python3 hello.py

app_env=${1:-development}

# Prefer activating Python virtual environment if present
if [ -f "bin/activate" ]; then
. bin/activate
fi

# Development environment commands
dev_commands() {
echo "Running development environment commands..."
python3 hello.py
}

# Production environment commands
prod_commands() {
echo "Running production environment commands..."
python3 hello.py
}

# Decide environment based on argument
if [ "$app_env" = "production" ] || [ "$app_env" = "prod" ] ; then
echo "Production environment detected"
prod_commands
else
echo "Development environment detected"
dev_commands
fi