diff --git a/.github/workflows/docker_deploy.yml b/.github/workflows/docker_deploy.yml new file mode 100644 index 00000000..bb9353c7 --- /dev/null +++ b/.github/workflows/docker_deploy.yml @@ -0,0 +1,39 @@ +name: Docker image deploy + +on: + push: + branches: + - main + paths: + - "backend/**" + workflow_dispatch: + inputs: + tag: + description: 'Docker image tag' + required: true + default: 'latest' + +jobs: + docker-deploy: + name: Docker deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Builder + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + run: | + cd backend/ + INPUT_TAG=${{ github.event.inputs.tag }} + TAG=${INPUT_TAG:-"latest"} + docker build -t ghcr.io/flatironinstitute/stan-wasm-server:$TAG . + docker push ghcr.io/flatironinstitute/stan-wasm-server:$TAG diff --git a/.github/workflows/vercel_deploy.yml b/.github/workflows/vercel_deploy.yml index 8018cfd1..8d43dc9a 100644 --- a/.github/workflows/vercel_deploy.yml +++ b/.github/workflows/vercel_deploy.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - vercel-deploy-2 # for initial test # manual trigger workflow_dispatch: @@ -13,24 +12,19 @@ jobs: name: Vercel deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Install Vercel CLI - run: npm install --global vercel@latest - - - name: Create .vercel/project.json - run: | - cd gui - mkdir -p .vercel - echo '{"projectId":"${{ secrets.VERCEL_PROJECT_ID }}", "orgId":"${{ secrets.VERCEL_ORG_ID }}"}' > .vercel/project.json - - - name: Pull Vercel Environment Information - run: | - cd gui - vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - - name: Build Project Artifacts - run: | - cd gui - vercel --prod --token=${{ secrets.VERCEL_TOKEN }} - + - uses: actions/checkout@v4 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Create .vercel/project.json + run: | + cd gui + mkdir -p .vercel + echo '{"projectId":"${{ secrets.VERCEL_PROJECT_ID }}", "orgId":"${{ secrets.VERCEL_ORG_ID }}"}' > .vercel/project.json + - name: Pull Vercel Environment Information + run: | + cd gui + vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: | + cd gui + vercel --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/backend/Dockerfile b/backend/Dockerfile index 0a2fd2ce..7f4c4d94 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,5 @@ # Dockerfile -FROM emscripten/emsdk:3.1.59 AS builder +FROM emscripten/emsdk:3.1.73 AS builder # Set the working directory WORKDIR /app @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y \ tar # Clone the oneTBB library and checkout the specific commit -RUN wget https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.13.0.tar.gz && \ +RUN wget https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v2021.13.0.tar.gz && \ tar -xvf v2021.13.0.tar.gz && \ mv oneTBB-2021.13.0 oneTBB @@ -40,7 +40,7 @@ RUN pip install uvicorn # Clone the TinyStan repository and checkout a specific commit RUN git clone https://github.com/WardBrian/tinystan.git && \ cd tinystan && \ - git checkout "e1e675ea21873e3365bb0d54a843f4c0f54bf6a8" && \ + git checkout "28e4156837260d8e752dfc50c00fbe2409236c11" && \ git submodule update --init --recursive # Copy the local configuration file for TinyStan diff --git a/backend/build_and_push.sh b/backend/build_and_push.sh deleted file mode 100644 index 9d2e87e7..00000000 --- a/backend/build_and_push.sh +++ /dev/null @@ -1,9 +0,0 @@ -IMAGE_NAME=magland/stan-wasm-server - -docker build -t $IMAGE_NAME . - -# prompt user to continue -echo "Press any key to continue to push to docker hub..." -read -n 1 -s - -docker push $IMAGE_NAME diff --git a/docs/compilation_server_setup.md b/docs/compilation_server_setup.md index 139e1435..9b814201 100644 --- a/docs/compilation_server_setup.md +++ b/docs/compilation_server_setup.md @@ -5,7 +5,7 @@ These instructions are only required if you want to set up your own compilation To run your own server locally using Docker, execute the following command: ``` -docker run -p 8083:8080 -it magland/stan-wasm-server:latest +docker run -p 8083:8080 -it ghcr.io/flatironinstitute/stan-wasm-server:latest ``` After setting up the server, navigate to https://stan-playground.flatironinstitute.org. diff --git a/gui/src/app/Compilation/Control/CompilationServerDialog.tsx b/gui/src/app/Compilation/Control/CompilationServerDialog.tsx index a955f1bb..9ebfe1a2 100644 --- a/gui/src/app/Compilation/Control/CompilationServerDialog.tsx +++ b/gui/src/app/Compilation/Control/CompilationServerDialog.tsx @@ -113,7 +113,8 @@ const ConfigureCompilationServerDialog: FunctionComponent<
- docker run -p 8083:8080 -it magland/stan-wasm-server:latest + docker run -p 8083:8080 -it + ghcr.io/flatironinstitute/stan-wasm-server:latest