From 76d26e36bc5867322a7775e78eb72087617f06b1 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Fri, 11 Oct 2024 18:46:14 +0530 Subject: [PATCH 1/2] fix deploy --- .github/workflows/cd-deploy.yaml | 4 ++-- justfile | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd-deploy.yaml b/.github/workflows/cd-deploy.yaml index fc5dea73..5f3532fe 100644 --- a/.github/workflows/cd-deploy.yaml +++ b/.github/workflows/cd-deploy.yaml @@ -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 diff --git a/justfile b/justfile index b22685e5..00c26c4e 100644 --- a/justfile +++ b/justfile @@ -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 @@ -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 @@ -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 From 154670eccc1770f59e8dab2d568a92c735b8ed80 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Fri, 11 Oct 2024 18:56:23 +0530 Subject: [PATCH 2/2] fix server art to use prod url --- syftbox/server/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/syftbox/server/server.py b/syftbox/server/server.py index 19690e3c..006bc3b4 100644 --- a/syftbox/server/server.py +++ b/syftbox/server/server.py @@ -182,7 +182,7 @@ 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 @@ -190,7 +190,10 @@ async def lifespan(app: FastAPI, settings: ServerSettings | None = None): @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