Skip to content

Commit 4944bda

Browse files
committed
Add 'packages/syftbox/' from commit 'afa649e9af677f8c89eff28555a09c65ca0eaeb3'
git-subtree-dir: packages/syftbox git-subtree-mainline: 6a6b9ff git-subtree-split: afa649e
2 parents 6a6b9ff + afa649e commit 4944bda

File tree

211 files changed

+22963
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+22963
-0
lines changed

packages/syftbox/.bumpversion.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[bumpversion]
2+
current_version = 0.3.5
3+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
4+
serialize =
5+
{major}.{minor}.{patch}
6+
7+
[bumpversion:file:pyproject.toml]
8+
9+
[bumpversion:file:syftbox/__init__.py]
10+
11+
[bumpversion:file:docker/syftbox.dockerfile]

packages/syftbox/.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
data
3+
default_apps
4+
dist
5+
docker
6+
notebooks
7+
projects
8+
tests
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Test - Apps Standalone
2+
3+
on:
4+
workflow_dispatch:
5+
6+
workflow_call:
7+
8+
jobs:
9+
apps-test:
10+
strategy:
11+
max-parallel: 99
12+
matrix:
13+
apps:
14+
- ring@main
15+
# - tutorial-apps@basic_aggregator
16+
# - tutorial-apps@pretrained_model_aggregator
17+
# - tutorial-apps@pretrained_model_local
18+
python-version: ["3.9"]
19+
os: [ubuntu-latest, macos-latest]
20+
# runner: [syftbox-sh-linux-x64, scaleway-macOS-arm64]
21+
fail-fast: false
22+
23+
# runs-on: ${{ matrix.runner }}
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- name: Parse app repository info
27+
id: apprepo
28+
run: |
29+
REPO=$(echo ${{ matrix.apps }} | cut -d'@' -f1)
30+
REF=$(echo ${{ matrix.apps }} | cut -d'@' -f2)
31+
echo "REPO=$REPO" >> $GITHUB_OUTPUT
32+
echo "REF=$REF" >> $GITHUB_OUTPUT
33+
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
repository: OpenMined/${{ steps.apprepo.outputs.REPO }}
38+
ref: ${{ steps.apprepo.outputs.REF }}
39+
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v5
42+
with:
43+
version: "0.4.25"
44+
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
50+
- name: Provisioning dummy config
51+
run: |
52+
CONFIG_PATH="$(pwd)/config.json"
53+
SYNC_FOLDER="$(pwd)/sync/"
54+
echo '{
55+
"config_path": "'"$CONFIG_PATH"'",
56+
"sync_folder": "'"$SYNC_FOLDER"'",
57+
"port": 8011,
58+
"email": "alice@openmined.org",
59+
"token": null,
60+
"server_url": "http://localhost:5001",
61+
"email_token": null,
62+
"autorun_plugins": [
63+
"init",
64+
"create_datasite",
65+
"sync",
66+
"apps"
67+
]
68+
}' > $CONFIG_PATH
69+
cat $CONFIG_PATH
70+
71+
- name: Run the test
72+
run: |
73+
chmod +x ./run.sh
74+
export SYFTBOX_CLIENT_CONFIG_PATH="$(pwd)/config.json"
75+
sh ./run.sh
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Deploy Stage
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build:
7+
description: Deploy build from
8+
type: choice
9+
default: local
10+
options:
11+
- local
12+
- pypi
13+
14+
version:
15+
description: SyftBox version to deploy if above is "pypi"
16+
type: string
17+
default: 0.1.12
18+
19+
dryrun:
20+
description: Dry Run. Will not deploy to server.
21+
type: boolean
22+
default: false
23+
24+
push:
25+
branches:
26+
- main # adjust this to match your main branch name
27+
paths:
28+
- "syftbox/**" # Python package files
29+
- "default_apps/**" # Default Apps
30+
- "pyproject.toml" # Project configuration
31+
- "uv.lock" # Project lock
32+
- "MANIFEST.in" # Wheel manifest
33+
- "bumpversion.cfg" # Version
34+
35+
# Prevents concurrent runs of the same workflow
36+
# while the previous run is still in progress
37+
concurrency:
38+
group: deploy-syftbox-stage
39+
cancel-in-progress: false
40+
41+
jobs:
42+
deploy-syftbox-stage:
43+
# runs-on: ubuntu-latest
44+
runs-on: syftbox-sh-linux-x64
45+
46+
steps:
47+
- name: Install Git & SSH
48+
if: runner.os == 'Linux'
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install git openssh-client -y
52+
53+
- name: Install uv
54+
uses: astral-sh/setup-uv@v5
55+
with:
56+
version: "0.4.25"
57+
58+
- name: Checkout SyftBox repo
59+
uses: actions/checkout@v4
60+
61+
- name: Install Just
62+
uses: extractions/setup-just@v2
63+
with:
64+
just-version: "1.36.0"
65+
66+
- name: Set up SSH
67+
run: |
68+
mkdir -p ~/.ssh
69+
echo "${{ secrets.SYFTBOX_STAGE_PRIVATE_KEY }}" > ~/.ssh/cert.pem
70+
chmod 600 ~/.ssh/cert.pem
71+
ssh-keyscan -H "4.227.144.171" >> ~/.ssh/known_hosts
72+
73+
- name: Deploy SyftBox (Local Wheel Build)
74+
# allow local deployment only on workflow_dispatch and non-PR push
75+
if: |
76+
(github.event_name == 'workflow_dispatch' && inputs.dryrun == false && inputs.build == 'local') ||
77+
(github.event_name == 'push' && github.event.pull_request == null)
78+
run: |
79+
just upload-dev ~/.ssh/cert.pem azureuser@4.227.144.171
80+
81+
- name: Deploy SyftBox (PyPI ${{ inputs.version }})
82+
# allow pypi deployment only on workflow_dispatch
83+
if: |
84+
(github.event_name == 'workflow_dispatch' && inputs.dryrun == false && inputs.build == 'pypi') || false
85+
run: |
86+
just upload-pip ${{ inputs.version }} ~/.ssh/cert.pem azureuser@4.227.144.171
87+
88+
- name: Delete cert.pem
89+
if: always()
90+
run: |
91+
rm -f ~/.ssh/cert.pem
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy Prod
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "SyftBox Version to deploy"
8+
type: string
9+
default: 0.1.12
10+
11+
dryrun:
12+
description: Dry Run. Will not deploy to server.
13+
type: boolean
14+
default: false
15+
16+
# Prevents concurrent runs of the same workflow
17+
# while the previous run is still in progress
18+
concurrency:
19+
group: deploy-syftbox-prod
20+
cancel-in-progress: false
21+
22+
jobs:
23+
deploy-syftbox-prod:
24+
# runs-on: ubuntu-latest
25+
runs-on: syftbox-sh-linux-x64
26+
27+
steps:
28+
- name: Install Git & SSH
29+
if: runner.os == 'Linux'
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install git openssh-client -y
33+
34+
- name: Checkout SyftBox repo
35+
uses: actions/checkout@v4
36+
37+
- name: Install Just
38+
uses: extractions/setup-just@v2
39+
with:
40+
just-version: "1.36.0"
41+
42+
- name: Set up SSH
43+
run: |
44+
mkdir -p ~/.ssh
45+
echo "${{ secrets.SYFTBOX_SERVER_PRIVATE_KEY }}" > ~/.ssh/cert.pem
46+
chmod 600 ~/.ssh/cert.pem
47+
ssh-keyscan -H "172.210.40.183" >> ~/.ssh/known_hosts
48+
49+
- name: Deploy SyftBox Server
50+
if: ${{ inputs.dryrun == false && github.event_name != 'pull_request' }}
51+
run: |
52+
just upload-pip ${{ inputs.version }} ~/.ssh/cert.pem azureuser@172.210.40.183
53+
54+
- name: Delete cert.pem
55+
if: always()
56+
run: |
57+
rm -f ~/.ssh/cert.pem
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: SyftBox PyPI Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump_type:
7+
description: Bump bersion by
8+
type: choice
9+
default: patch
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
breaking_changes:
16+
description: Use this if minor release and not compatible with previous versions
17+
type: boolean
18+
default: false
19+
20+
run_tests:
21+
description: Run pre-release tests
22+
type: boolean
23+
default: true
24+
25+
dryrun:
26+
description: Dry Run. Will not push to PyPI.
27+
type: boolean
28+
default: false
29+
30+
# Prevents concurrent runs of the same workflow
31+
# while the previous run is still in progress
32+
concurrency:
33+
group: release-syftbox
34+
cancel-in-progress: false
35+
36+
jobs:
37+
call-pr-tests:
38+
if: ${{ inputs.run_tests == true }}
39+
uses: ./.github/workflows/pr-tests.yaml
40+
41+
deploy-syftbox:
42+
needs: [call-pr-tests]
43+
if: |
44+
always() &&
45+
(needs.call-pr-tests.result == 'success' || needs.call-pr-tests.result == 'skipped')
46+
47+
# runs-on: ubuntu-latest
48+
runs-on: syftbox-sh-linux-x64
49+
50+
steps:
51+
- name: Install Git
52+
if: runner.os == 'Linux'
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install git -y
56+
57+
- name: Checkout SyftBox repo with github token
58+
uses: actions/checkout@v4
59+
with:
60+
token: ${{ secrets.SYFTBOX_BOT_COMMIT_TOKEN }}
61+
62+
- name: Configure git user
63+
run: |
64+
git config user.name "${{ secrets.OM_BOT_NAME }}"
65+
git config user.email "${{ secrets.OM_BOT_EMAIL }}"
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: "3.12"
71+
72+
- name: Install uv
73+
uses: astral-sh/setup-uv@v5
74+
with:
75+
version: "0.4.25"
76+
77+
- name: Install Just
78+
uses: extractions/setup-just@v2
79+
with:
80+
just-version: "1.36.0"
81+
82+
- name: Install dependencies
83+
run: |
84+
uv --version
85+
uv tool install twine
86+
twine --version
87+
88+
- name: Bump the Version
89+
run: |
90+
just bump-version ${{ inputs.bump_type }} ${{ inputs.breaking_changes }}
91+
92+
- name: Build syftbox
93+
run: |
94+
just build
95+
96+
- name: Push to pypi
97+
if: ${{ inputs.dryrun == false && github.event_name != 'pull_request' }}
98+
run: |
99+
twine upload -u __token__ -p ${{ secrets.OM_SYFTBOX_PYPI_TOKEN }} dist/*
100+
101+
- name: Push changes to SyftBox repo
102+
if: ${{ inputs.dryrun == false && github.event_name != 'pull_request' }}
103+
run: |
104+
git push origin --follow-tags

0 commit comments

Comments
 (0)