Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker system prune action Iteration=2 #1068

Merged
merged 3 commits into from
Dec 29, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/build_deploy_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build and push ${{ matrix.service }}
uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
context: ./zubhub_backend/
file: ./zubhub_backend/compose/${{ matrix.service }}/prod/Dockerfile
Expand All @@ -40,16 +40,16 @@ jobs:

- uses: unstructuredstudio/zubhub/.github/actions/scp_action@master
with:
host: ${{ secrets.DO_BACKEND_HOST }}
username: ${{ secrets.DO_BACKEND_USERNAME }}
host: ${{ vars.DO_BACKEND_HOST }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
source: "."
target: "/home/zubhub-services/zubhub"

- uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
host: ${{ secrets.DO_BACKEND_HOST }}
username: ${{ secrets.DO_BACKEND_USERNAME }}
host: ${{ vars.DO_BACKEND_HOST }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |
cp /home/zubhub-services/zubhub/zubhub_backend/compose/deploy_backend.sh /home/zubhub-services/
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
host: ${{ matrix.host }}
username: ${{ secrets.DO_BACKEND_USERNAME }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build_deploy_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build and push frontend
uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
context: ./zubhub_frontend/zubhub/
file: ./zubhub_frontend/zubhub/Dockerfile.prod
Expand All @@ -37,16 +37,16 @@ jobs:

- uses: unstructuredstudio/zubhub/.github/actions/scp_action@master
with:
host: ${{ secrets.DO_BACKEND_HOST }}
username: ${{ secrets.DO_BACKEND_USERNAME }}
host: ${{ vars.DO_BACKEND_HOST }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
source: "."
target: "/home/zubhub-frontend/zubhub"

- uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
host: ${{ secrets.DO_FRONTEND_HOST }}
username: ${{ secrets.DO_FRONTEND_USERNAME }}
host: ${{ vars.DO_FRONTEND_HOST }}
username: ${{ vars.DO_FRONTEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |
cp /home/zubhub-frontend/zubhub/zubhub_frontend/zubhub/deploy_frontend.sh /home/zubhub-frontend/
Expand All @@ -59,8 +59,8 @@ jobs:
- name: Execute docker system prune on frontend host
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
host: ${{ secrets.DO_FRONTEND_HOST }}
username: ${{ secrets.DO_FRONTEND_USERNAME }}
host: ${{ vars.DO_FRONTEND_HOST }}
username: ${{ vars.DO_FRONTEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create_destroy_test_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }}
with:
host: ${{env.NEW_DROPLET_IP}}
username: ${{ secrets.DO_BACKEND_USERNAME }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
source: "."
target: "/home/zubhub"
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Build and push ${{ matrix.service }}
uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
# for frontend, context is ./zubhub_frontend/zubhub/
# for backend services, context is ./zubhub_backend/
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
host: ${{env.NEW_DROPLET_IP}}
username: ${{ secrets.DO_BACKEND_USERNAME }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/locust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build and push locust
uses: unstructuredstudio/zubhub/.github/actions/docker_build_and_push@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
context: ./locust/
file: ./locust/Dockerfile
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }}
with:
host: ${{ env.NEW_DROPLET_IP }}
username: ${{ secrets.DO_BACKEND_USERNAME }}
username: ${{ vars.DO_BACKEND_USERNAME }}
key: ${{ secrets.DO_SSHKEY }}
script: |
docker run -d -p 8089:8089 unstructuredstudio/zubhub-services_locust:latest \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/scale_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
NEW_DROPLET_IP: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).NEW_DROPLET_IP }}
with:
HOST: ${{ env.NEW_DROPLET_IP }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
USERNAME: ${{ vars.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "docker swarm join --token ${{secrets.SWARM_WORKER_JOIN_TOKEN}} ${{secrets.SWARM_MASTER_HOST_AND_PORT}};sleep 10"

Expand All @@ -49,8 +49,8 @@ jobs:
env:
TARGET_DROPLETS_COUNT: ${{ fromJson(steps.create_droplet.outputs.JSON_STRING).TARGET_DROPLETS_COUNT }}
with:
HOST: ${{ secrets.DO_BACKEND_HOST }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
HOST: ${{ vars.DO_BACKEND_HOST }}
USERNAME: ${{ vars.DO_BACKEND_USERNAME
KEY: ${{ secrets.DO_SSHKEY }}
script: "docker service scale zubhub-services_web=${{env.TARGET_DROPLETS_COUNT}}"

Expand Down Expand Up @@ -81,8 +81,8 @@ jobs:
if: ${{ env.TARGET_DROPLETS_COUNT > 0 }}
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
HOST: ${{ secrets.DO_BACKEND_HOST }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
HOST: ${{ vars.DO_BACKEND_HOST }}
USERNAME: ${{ vars.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "docker service scale zubhub-services_web=${{env.TARGET_DROPLETS_COUNT}}"

Expand All @@ -94,7 +94,7 @@ jobs:
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
HOST: ${{ env.TARGET_DROPLET_IP }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
USERNAME: ${{ vars.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "docker swarm leave;sleep 5s"

Expand All @@ -115,7 +115,7 @@ jobs:
if: ${{ env.TARGET_DROPLETS_COUNT > 0 }}
uses: unstructuredstudio/zubhub/.github/actions/ssh_action@master
with:
HOST: ${{ secrets.DO_BACKEND_HOST }}
USERNAME: ${{ secrets.DO_BACKEND_USERNAME }}
HOST: ${{ vars.DO_BACKEND_HOST }}
USERNAME: ${{ vars.DO_BACKEND_USERNAME }}
KEY: ${{ secrets.DO_SSHKEY }}
script: "docker node rm zubhub-services-${{env.TARGET_DROPLETS_COUNT}}"