Skip to content

Commit

Permalink
better handling of incremental update of cached docker CI containers
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Apr 29, 2024
1 parent 07e51c0 commit 188410d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/common-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,10 @@ jobs:
build-client:
runs-on: vm-client
env:
SERVER_ADDRESS: ${{ inputs.server_private_address }}
GO_VERSION: 1.20.14
CMAKE_VERSION: '3.22.x'
GH_TOKEN: ${{ github.token }}
CACHE_KEY: qpep-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
QPEP_REPO: https://github.com/${{github.repository}}.git
QPEP_BRANCH: ${{ github.head_ref || github.ref_name }}
QPEP_REV: ${{ github.sha }}
QPEP_GATEWAY: ${{ inputs.server_public_address }}
QPEP_ADDRESS: ${{ inputs.client_listen_address }}
QPEP_BACKEND: ${{ inputs.backend }}
QPEP_CCA: ${{ inputs.cca }}
QPEP_SLOWSTART: ${{ inputs.slowstart }}
steps:
- name: Install the github cli
uses: sersoft-gmbh/setup-gh-cli-action@v2
Expand Down Expand Up @@ -181,19 +172,8 @@ jobs:
runs-on: vm-client
needs: [build-client, build-server]
env:
SERVER_ADDRESS: ${{ inputs.server_private_address }}
GO_VERSION: 1.20.14
CMAKE_VERSION: '3.22.x'
GH_TOKEN: ${{ github.token }}
CACHE_KEY: qpep-${{ github.head_ref || github.ref_name }}-${{ github.sha }}
QPEP_REPO: https://github.com/${{github.repository}}.git
QPEP_BRANCH: ${{ github.head_ref || github.ref_name }}
QPEP_REV: ${{ github.sha }}
QPEP_GATEWAY: ${{ inputs.server_public_address }}
QPEP_ADDRESS: ${{ inputs.client_listen_address }}
QPEP_BACKEND: ${{ inputs.backend }}
QPEP_CCA: ${{ inputs.cca }}
QPEP_SLOWSTART: ${{ inputs.slowstart }}
strategy:
max-parallel: 1
matrix:
Expand Down Expand Up @@ -313,7 +293,6 @@ jobs:
build-server:
runs-on: vm-server
env:
SERVER_ADDRESS: ${{ inputs.server_private_address }}
GO_VERSION: 1.20.14
CMAKE_VERSION: '3.22.x'
GH_TOKEN: ${{ github.token }}
Expand Down
2 changes: 1 addition & 1 deletion docker/server-env/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ services:
mode: host
network_mode: "host"
entrypoint:
- /root/run-qpep.sh
- /root/run-qpep.sh ${QPEP_REPO} ${QPEP_BRANCH} ${QPEP_REV}
31 changes: 15 additions & 16 deletions docker/server-env/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ ENV CGO_ENABLED "1"
ENV GOROOT "/opt/go"
ENV GOPATH "/opt/gopath"
ENV BUILDKIT_PROGRESS "plain"

ARG QPEP_BACKEND="quic-go"
ARG QPEP_CCA="reno"
ARG QPEP_SLOWSTART="basic"
ARG QPEP_ADDRESS="127.0.0.1"
ARG QPEP_GATEWAY="127.0.0.1"
ARG GO_VERSION="1.20.14"
ARG QPEP_REPO="https://github.com/Project-Faster/qpep.git"
ARG QPEP_BRANCH="main"
ARG QPEP_REV="HEAD"
ENV QPEP_BACKEND="quic-go"
ENV QPEP_CCA="reno"
ENV QPEP_SLOWSTART="basic"
ENV QPEP_ADDRESS="127.0.0.1"
ENV QPEP_GATEWAY="127.0.0.1"
ENV GO_VERSION="1.20.14"
ENV QPEP_REPO="https://github.com/Project-Faster/qpep.git"
ENV QPEP_BRANCH="main"
ENV QPEP_REV="HEAD"

USER root

Expand Down Expand Up @@ -46,11 +45,11 @@ git submodule update \n\
' > /root/clone-qpep.sh

RUN printf '#!/bin/bash -xe \n\
echo [UPDATE to ${QPEP_REPO}@${QPEP_BRANCH}:${QPEP_REV}] \n\
echo [UPDATE to $1@$2:$3] \n\
cd /root/qpep \n\
git switch ${QPEP_BRANCH} \n\
if [[ ! "${QPEP_REV}" -eq "HEAD" ]]; then \n\
git reset --hard ${QPEP_REV} \n\
git switch $2 \n\
if [[ ! "$3" -eq "HEAD" ]]; then \n\
git reset --hard $3 \n\
fi \n\
git pull \n\
' > /root/update-qpep.sh
Expand All @@ -77,15 +76,15 @@ mkdir -p /opt/build/config \n\

WORKDIR /root
RUN printf '#!/bin/bash -xe \n\
/root/update-qpep.sh \n\
/root/update-qpep.sh $1 $2 $3 \n\
/root/backends-qpep.sh \n\
/root/build-qpep.sh \n\
envsubst < /root/qpep/docker/server-env/server/config/qpep.yml.tpl > /opt/build/config/qpep.yml \n\
cat /opt/build/config/qpep.yml \n\
cp /root/qpep/docker/server-env/server/*.pem /opt/build/ \n\
ping -c 3 MQTT \n\
cd /opt/build \n\
./qpep $1 \n\
./qpep \n\
' > /root/run-qpep.sh

RUN sh -c 'dos2unix /root/*.sh'
Expand Down

0 comments on commit 188410d

Please sign in to comment.