From 188f53847af94e19e88b4975d3b40ea948c3d8c3 Mon Sep 17 00:00:00 2001 From: jojoc4 Date: Tue, 27 Dec 2022 15:19:12 +0100 Subject: [PATCH] convert remaining docker build to git action --- .github/workflows/docker-image.yml | 30 +++++++++++++++++++++++++++++ Benchmarks/files/blender/Dockerfile | 2 +- Benchmarks/files/dl/Dockerfile | 4 ++-- Benchmarks/files/docker/run.sh | 20 +++++++++---------- Benchmarks/files/fio/Dockerfile | 2 +- Benchmarks/files/hpcc/Dockerfile | 2 +- Benchmarks/files/k8s/run.sh | 20 +++++++++---------- Benchmarks/files/rest/Dockerfile | 2 +- 8 files changed, 56 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ed17df6..1b58cd8 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -49,3 +49,33 @@ jobs: push: true tags: jojoc4/lsbs-bdd:latest file: Benchmarks/files/bdd/Dockerfile + - name: Build and push blender + uses: docker/build-push-action@v3 + with: + push: true + tags: jojoc4/lsbs-blender:latest + file: Benchmarks/files/blender/Dockerfile + - name: Build and push dl + uses: docker/build-push-action@v3 + with: + push: true + tags: jojoc4/lsbs-dl:latest + file: Benchmarks/files/dl/Dockerfile + - name: Build and push fio + uses: docker/build-push-action@v3 + with: + push: true + tags: jojoc4/lsbs-fio:latest + file: Benchmarks/files/fio/Dockerfile + - name: Build and push hpcc + uses: docker/build-push-action@v3 + with: + push: true + tags: jojoc4/lsbs-hpcc:latest + file: Benchmarks/files/hpcc/Dockerfile + - name: Build and push rest + uses: docker/build-push-action@v3 + with: + push: true + tags: jojoc4/lsbs-rest:latest + file: Benchmarks/files/rest/Dockerfile diff --git a/Benchmarks/files/blender/Dockerfile b/Benchmarks/files/blender/Dockerfile index 6cd43b4..1a210de 100644 --- a/Benchmarks/files/blender/Dockerfile +++ b/Benchmarks/files/blender/Dockerfile @@ -1,6 +1,6 @@ FROM nvidia/cuda:11.3.0-devel-ubuntu20.04 RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y wget bzip2 libfreetype6 libgl1-mesa-dev libglu1-mesa libxi6 libxrender1 curl -ADD ./* /bench/ +ADD ./Benchmarks/files/blender/* /bench/ RUN chmod +x /bench/run.sh WORKDIR /bench/ RUN wget https://download.blender.org/release/BlenderBenchmark2.0/launcher/benchmark-launcher-cli-3.1.0-linux.tar.gz diff --git a/Benchmarks/files/dl/Dockerfile b/Benchmarks/files/dl/Dockerfile index cff48a5..e083b75 100644 --- a/Benchmarks/files/dl/Dockerfile +++ b/Benchmarks/files/dl/Dockerfile @@ -1,7 +1,7 @@ FROM nvcr.io/nvidia/tensorflow:22.08-tf2-py3 RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y python3-pip unzip curl -ADD ./* /bench/ -ADD img /bench/img +ADD ./Benchmarks/files/dl/* /bench/ +ADD ./Benchmarks/files/dl/img /bench/img RUN chmod +x /bench/run.sh WORKDIR /bench/ RUN pip3 install -r requirements.txt diff --git a/Benchmarks/files/docker/run.sh b/Benchmarks/files/docker/run.sh index b425190..6b3d9d1 100644 --- a/Benchmarks/files/docker/run.sh +++ b/Benchmarks/files/docker/run.sh @@ -1,21 +1,21 @@ #!/bin/bash case "$BENCHMARK" in -0) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-hpcc - docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-fio +0) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-hpcc + docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-fio docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME jojoc4/lsbs-iperf - docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-blender - docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-dl + docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-blender + docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-dl docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-bdd - docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME -p 30500:5000 registry.jojoc4.ch/tm-rest + docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME -p 30500:5000 jojoc4/lsbs-rest ;; -1) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-hpcc ;; -2) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-fio ;; +1) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-hpcc ;; +2) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-fio ;; 3) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME jojoc4/lsbs-iperf ;; -4) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-blender ;; +4) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-blender ;; 5) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-bdd ;; -6) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE registry.jojoc4.ch/tm-dl ;; -7) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME -p 30500:5000 registry.jojoc4.ch/tm-rest ;; +6) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE jojoc4/lsbs-dl ;; +7) docker run --rm -e CONTROLPLANEIP=$CONTROLPLANEIP -e SYSTEM=$SYSTEM -e TYPE=$TYPE -e SERVERNAME=$SERVERNAME -p 30500:5000 jojoc4/lsbs-rest ;; esac docker system prune -af \ No newline at end of file diff --git a/Benchmarks/files/fio/Dockerfile b/Benchmarks/files/fio/Dockerfile index e849bd1..ba42e37 100644 --- a/Benchmarks/files/fio/Dockerfile +++ b/Benchmarks/files/fio/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y fio curl -ADD ./* /bench/ +ADD ./Benchmarks/files/fio/* /bench/ RUN chmod +x /bench/run.sh WORKDIR /bench/ ENTRYPOINT ./run.sh \ No newline at end of file diff --git a/Benchmarks/files/hpcc/Dockerfile b/Benchmarks/files/hpcc/Dockerfile index 6c76351..31cb689 100644 --- a/Benchmarks/files/hpcc/Dockerfile +++ b/Benchmarks/files/hpcc/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y hpcc curl -ADD ./* /bench/ +ADD ./Benchmarks/files/hpcc/* /bench/ RUN chmod +x /bench/run.sh WORKDIR /bench/ ENV OMPI_ALLOW_RUN_AS_ROOT=1 diff --git a/Benchmarks/files/k8s/run.sh b/Benchmarks/files/k8s/run.sh index fed2d46..2ad86bf 100644 --- a/Benchmarks/files/k8s/run.sh +++ b/Benchmarks/files/k8s/run.sh @@ -2,13 +2,13 @@ case "$BENCHMARK" in 0) - k0s kubectl run hpcc --image=registry.jojoc4.ch/tm-hpcc --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 + k0s kubectl run hpcc --image=jojoc4/lsbs-hpcc --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods hpcc --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done k0s kubectl delete pod hpcc --now - k0s kubectl run fio --image=registry.jojoc4.ch/tm-fio --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 + k0s kubectl run fio --image=jojoc4/lsbs-fio --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods fio --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done @@ -20,13 +20,13 @@ case "$BENCHMARK" in done k0s kubectl delete pod iperf --now - k0s kubectl run blender --image=registry.jojoc4.ch/tm-blender --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 + k0s kubectl run blender --image=jojoc4/lsbs-blender --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods blender --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done k0s kubectl delete pod blender --now - k0s kubectl run dl --image=registry.jojoc4.ch/tm-dl --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 + k0s kubectl run dl --image=jojoc4/lsbs-dl --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods dl --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done @@ -38,7 +38,7 @@ case "$BENCHMARK" in done k0s kubectl delete pod bdd --now - k0s kubectl run rest --image=registry.jojoc4.ch/tm-rest --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --env="SERVERNAME=$SERVERNAME" --restart=Never --request-timeout=0 --port=5000 + k0s kubectl run rest --image=jojoc4/lsbs-rest --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --env="SERVERNAME=$SERVERNAME" --restart=Never --request-timeout=0 --port=5000 k0s kubectl expose --type=NodePort pod rest --port 5000 --name web --overrides '{ "apiVersion": "v1","spec":{"ports": [{"port":5000,"protocol":"TCP","targetPort":5000,"nodePort":30500}]}}' while [[ $(k0s kubectl get pods rest --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 @@ -46,13 +46,13 @@ case "$BENCHMARK" in k0s kubectl delete svc web k0s kubectl delete pod rest --now ;; -1) k0s kubectl run hpcc --image=registry.jojoc4.ch/tm-hpcc --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 +1) k0s kubectl run hpcc --image=jojoc4/lsbs-hpcc --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods hpcc --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done k0s kubectl delete pod hpcc --now ;; -2) k0s kubectl run fio --image=registry.jojoc4.ch/tm-fio --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 +2) k0s kubectl run fio --image=jojoc4/lsbs-fio --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods fio --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done @@ -64,7 +64,7 @@ case "$BENCHMARK" in done k0s kubectl delete pod iperf --now ;; -4) k0s kubectl run blender --image=registry.jojoc4.ch/tm-blender --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 +4) k0s kubectl run blender --image=jojoc4/lsbs-blender --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods blender --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done @@ -76,13 +76,13 @@ case "$BENCHMARK" in done k0s kubectl delete pod bdd --now ;; -6) k0s kubectl run dl --image=registry.jojoc4.ch/tm-dl --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 +6) k0s kubectl run dl --image=jojoc4/lsbs-dl --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --restart=Never --request-timeout=0 while [[ $(k0s kubectl get pods dl --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 done k0s kubectl delete pod dl --now ;; -7) k0s kubectl run rest --image=registry.jojoc4.ch/tm-rest --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --env="SERVERNAME=$SERVERNAME" --restart=Never --request-timeout=0 --port=5000 +7) k0s kubectl run rest --image=jojoc4/lsbs-rest --env="CONTROLPLANEIP=$CONTROLPLANEIP" --env="SYSTEM=$SYSTEM" --env="TYPE=$TYPE" --env="SERVERNAME=$SERVERNAME" --restart=Never --request-timeout=0 --port=5000 k0s kubectl expose --type=NodePort pod rest --port 5000 --name web --overrides '{ "apiVersion": "v1","spec":{"ports": [{"port":5000,"protocol":"TCP","targetPort":5000,"nodePort":30500}]}}' while [[ $(k0s kubectl get pods rest --no-headers -o custom-columns=":status.phase") != "Succeeded" ]]; do sleep 1 diff --git a/Benchmarks/files/rest/Dockerfile b/Benchmarks/files/rest/Dockerfile index f0da704..e66813e 100644 --- a/Benchmarks/files/rest/Dockerfile +++ b/Benchmarks/files/rest/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y python3-pip curl -ADD ./* /bench/ +ADD ./Benchmarks/files/rest/* /bench/ RUN chmod +x /bench/run.sh WORKDIR /bench/ RUN pip install -r requirements.txt