Skip to content

Commit

Permalink
Merge pull request #101 from OpenMined/yash/fix-deploy
Browse files Browse the repository at this point in the history
fix deploy
  • Loading branch information
yashgorana authored Oct 11, 2024
2 parents b875fcf + e781424 commit 768ef26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
mkdir -p ~/.ssh
echo "${{ secrets.SYFTBOX_SERVER_PRIVATE_KEY }}" > ~/.ssh/syftbox.pem
chmod 600 ~/.ssh/syftbox.pem
ssh-keyscan -H "20.168.10.234" >> ~/.ssh/known_hosts
ssh-keyscan -H "172.210.40.183" >> ~/.ssh/known_hosts
- name: Deploy SyftBox Server
run: |
just upload-pip ${{ inputs.version }} ~/.ssh/syftbox.pem azureuser@20.168.10.234
just upload-pip ${{ inputs.version }} ~/.ssh/syftbox.pem azureuser@172.210.40.183
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ bump-version level="patch":

# Build & Deploy syftbox to a remote server using SSH
[group('deploy')]
upload-dev keyfile remote="azureuser@20.168.10.234": build
upload-dev keyfile remote="user@0.0.0.0": build
#!/bin/bash
set -eou pipefail

Expand All @@ -174,13 +174,13 @@ upload-dev keyfile remote="azureuser@20.168.10.234": build
ssh -i {{ keyfile }} {{ remote }} "uv venv && uv pip install $REMOTE_WHEEL"

# restart service
# TODO - syftbox service was created manually on 20.168.10.234
# NOTE - syftbox service is created manually on the remote server
ssh -i {{ keyfile }} {{ remote }} "sudo systemctl daemon-reload && sudo systemctl restart syftbox"
echo -e "{{ _green }}Deployed SyftBox local wheel to {{ remote }}{{ _nc }}"

# Deploy syftbox from pypi to a remote server using SSH
[group('deploy')]
upload-pip version keyfile remote="azureuser@20.168.10.234":
upload-pip version keyfile remote="user@0.0.0.0":
#!/bin/bash
set -eou pipefail

Expand All @@ -200,7 +200,7 @@ upload-pip version keyfile remote="azureuser@20.168.10.234":
# ---------------------------------------------------------------------------------------------------------------------

[group('utils')]
ssh keyfile remote="azureuser@20.168.10.234":
ssh keyfile remote="user@0.0.0.0":
ssh -i {{ keyfile }} {{ remote }}

# remove all local files & directories
Expand Down
7 changes: 5 additions & 2 deletions syftbox/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,18 @@ async def lifespan(app: FastAPI, settings: ServerSettings | None = None):
# Install Syftbox (MacOS and Linux)
curl -LsSf https://syftboxstage.openmined.org/install.sh | sh
curl -LsSf https://syftbox.openmined.org/install.sh | sh
# Run the client
syftbox client
"""


@app.get("/", response_class=PlainTextResponse)
async def get_ascii_art():
async def get_ascii_art(request: Request):
req_host = request.headers.get("host", "")
if "syftboxstage" in req_host:
return ascii_art.replace("syftbox.openmined.org", "syftboxstage.openmined.org")
return ascii_art


Expand Down

0 comments on commit 768ef26

Please sign in to comment.