Skip to content

[Argus] Improves 'HEAD /assets/{id}' requests latency by implementing caching QN requests #213

[Argus] Improves 'HEAD /assets/{id}' requests latency by implementing caching QN requests

[Argus] Improves 'HEAD /assets/{id}' requests latency by implementing caching QN requests #213

name: Publish Colossus/Argus/QueryNode Docker images
on:
workflow_dispatch:
pull_request:
jobs:
build_and_publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Extract Package Versions
id: extract_versions
shell: bash
run: |
echo "colossus_version=$(cat storage-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
echo "argus_version=$(cat distributor-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
echo "qn_version=$(cat query-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
- name: Make some space
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name == 'workflow_dispatch'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build joystream-node
run: RUNTIME_PROFILE=TESTING ./build-node-docker.sh
# docker/build-push-action doc:
# Be careful because any file mutation in the steps that precede the
# build step will be ignored, including processing of the .dockerignore file
# since the context is based on the Git reference. However, you can use
# the Path context using the context input alongside the actions/checkout action
# to remove this restriction.
- name: Build storage-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: colossus.Dockerfile
push: false
load: true
tags: joystream/storage-node:latest
- name: Build distributor-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: distributor-node.Dockerfile
push: false
load: true
tags: joystream/distributor-node:latest
- name: Build query-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: query-node.Dockerfile
push: false
load: true
tags: joystream/query-node:latest
- name: Test with latest images
run: |
yarn build:packages
cp docker-compose-no-bind-volumes.yml docker-compose.yml
./tests/network-tests/run-tests.sh content-directory
- name: Push new versions
if: github.event_name == 'workflow_dispatch'
run: |
docker image tag joystream/storage-node:latest joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }}
docker image tag joystream/distributor-node:latest joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }}
docker image tag joystream/query-node:latest joystream/query-node:${{ steps.extract_versions.outputs.qn_version }}
docker push joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }}
docker push joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }}
docker push joystream/query-node:${{ steps.extract_versions.outputs.qn_version }}
- name: Push latest tag
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
run: |
docker push joystream/storage-node:latest
docker push joystream/distributor-node:latest
docker push joystream/query-node:latest