From 316df6b7b56ca55b105194d80bb35242c61034bf Mon Sep 17 00:00:00 2001 From: Sebastien Gandon Date: Wed, 8 Feb 2023 14:39:57 +0100 Subject: [PATCH] update1 --- .github/workflows/stitch-workflow.yml | 82 +++++++++++++++++++++++ .github/workflows/test-docker-mirror.Xyml | 32 +++++++++ runnner.yaml | 62 +++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 .github/workflows/stitch-workflow.yml create mode 100644 .github/workflows/test-docker-mirror.Xyml create mode 100644 runnner.yaml diff --git a/.github/workflows/stitch-workflow.yml b/.github/workflows/stitch-workflow.yml new file mode 100644 index 0000000..06272ae --- /dev/null +++ b/.github/workflows/stitch-workflow.yml @@ -0,0 +1,82 @@ +name: Run helm tests + +env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: 'us-east-1' + LEIN_USERNAME: ${{ secrets.AWS_ACCESS_KEY_ID }} + LEIN_PASSPHRASE: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + HELM_GIT_PATH: "stitch-observability-service" + CONFLUENT_PUBLIC_HELM_URL: "https://confluentinc.github.io/cp-helm-charts/" + BITNAMI_PUBLIC_HELM_URL: "https://charts.bitnami.com/bitnami" + ARTIFACTORY_HELM_URL: "https://artifactory.datapwn.com/artifactory/tlnd-helm-dev" + +on: + workflow_dispatch: + push: + + +jobs: + helm_test: + runs-on: [self-hosted] + steps: + - name: Log to Artifactory + uses: docker/login-action@v2 + with: + registry: https://artifactory.datapwn.com + username: sgandon + password: ${{ secrets.ARTIFACTORY_API_KEY }} + + - name: Helm tool installer + uses: Azure/setup-helm@v3.4 + + - name: Install kubectl + uses: azure/setup-kubectl@v3 + + # - name: install k3s + # uses: rohan397/actions-k3s@fix/update-set-output + + # - name: Install helm repos + # run: | + # helm repo add confluentinc ${{ env.CONFLUENT_PUBLIC_HELM_URL}} + # helm repo add bitnami ${{env.BITNAMI_PUBLIC_HELM_URL}} + # helm repo add talend ${{ env.ARTIFACTORY_HELM_URL}} --username github-actions-stitch --password ${{ secrets.ARTIFACTORY_API_KEY }} + + # - name: Fetch helm chart + # run: | + # helm fetch --untar talend/stitch-observability-service + + # - name: Echo chart definition + # run: | + # chart_def=$(helm show chart ${{ env.HELM_GIT_PATH}}) + # echo "will install stitch-observability-service: \n + # $chart_def" + + # - name: Create secret + # run: | + # kubectl create namespace github-action-stitch # not sure why we need this but creating the secret fails without it + # kubectl create secret docker-registry talend-registry \ + # --docker-server=artifactory.datapwn.com \ + # --docker-username=github-actions-stitch \ + # --docker-password=${{ secrets.ARTIFACTORY_API_KEY }} + + # - name: Create stack with candidate images + # run: | + # helm install stitch-observability-service ${{ env.HELM_GIT_PATH}} \ + # -f ${{ env.HELM_GIT_PATH}}/values-ci.yaml \ + # --wait --timeout 10m0s \ + # --set additionalEnvVars.normal.STITCH_OBSERVABILITY_DB_USER=avize \ + # --set additionalEnvVars.normal.STITCH_OBSERVABILITY_DB_PASSWORD=avize + + # - name: Test image + # run: | + # helm test stitch-observability-service + + # - name: Show test logs + # if: ${{ failure() }} + # run: | + # kubectl logs stitch-observability-service-partitions-test + # kubectl logs stitch-observability-service-lein-test + - name: test wait + run: sleep 2040 diff --git a/.github/workflows/test-docker-mirror.Xyml b/.github/workflows/test-docker-mirror.Xyml new file mode 100644 index 0000000..44d5277 --- /dev/null +++ b/.github/workflows/test-docker-mirror.Xyml @@ -0,0 +1,32 @@ +name: Run helm tests + + +on: + workflow_dispatch: + push: + + + +jobs: + test-talend-mirror: + runs-on: [self-hosted] + steps: + - name: test mirror + run: docker pull alpine/helm:3.9.3 + - name: Log into Artifactory + uses: docker/login-action@v2 + with: + registry: https://artifactory.datapwn.com + username: sgandon + password: ${{ secrets.ARTIFACTORY_API_KEY }} + - name: test mirror2 + run: docker pull alpine/helm:3.9.4 + - name: test wait + run: sleep 60 + + + + + + + diff --git a/runnner.yaml b/runnner.yaml new file mode 100644 index 0000000..9ad00b8 --- /dev/null +++ b/runnner.yaml @@ -0,0 +1,62 @@ +apiVersion: actions.summerwind.dev/v1alpha1 +kind: RunnerDeployment +metadata: + name: example-runnerdeploy +spec: + replicas: 1 + template: + spec: + repository: sgandon/self-hosted-runner-test + image: artifactory.datapwn.com/docker-io-remote/summerwind/actions-runner-dind:v2.299.1-ubuntu-20.04-aa6dab5 + imagePullSecrets: + - name: talend-registry + dockerEnabled: false + dockerRegistryMirror: https://docker-io-remote.cd.datapwn.com + dockerdWithinRunnerContainer: true + securityContext: + fsGroup: 1000 + hostAliases: + - ip: "127.0.0.1" + hostnames: + - "index.docker.io" + - "registry-1.docker.io" + - "docker.io" + volumeMounts: + - name: cache-runner + mountPath: /runner/_work + - name: cache-docker + mountPath: /home/runner/.docker + - name: cache-tools + mountPath: /opt/hostedtoolcache + - name: docker-conf-rw + mountPath: /home/runner/.docker/ + + + initContainers: + - name: copy-docker-config + image: artifactory.datapwn.com/docker-io-remote/busybox:1.34.1 + command: + - "sh" + - "-c" + - > + set -x; + cp /docker-conf-ro/config.json /docker-conf-rw/config.json; + + volumeMounts: + - name: docker-conf-rw + mountPath: /docker-conf-rw + - name: github-actions-runner-registry + mountPath: /docker-conf-ro/config.json + subPath: .dockerconfigjson + volumes: + - name: cache-runner + emptyDir: {} + - name: cache-docker + emptyDir: {} + - name: cache-tools + emptyDir: {} + - name: docker-conf-rw + emptyDir: {} + - name: github-actions-runner-registry + secret: + secretName: mirror-registry