Skip to content

Commit

Permalink
NODE-5655 add docker auth to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
braek-neck committed Aug 26, 2024
1 parent fbeda2b commit 98ade80
Show file tree
Hide file tree
Showing 23 changed files with 5,648 additions and 38 deletions.
69 changes: 53 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
smoke:
- 'test/smoke/*'
build:
name: Build images
runs-on: ${{ matrix.RUNNER }}
Expand Down Expand Up @@ -83,13 +85,18 @@ jobs:
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Login to DockerHub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Build controller images
env:
REGISTRY: wallarm
TAG: 1.0.0-dev
USER: runner
run: |
echo ${DOCKERHUB_PASSWORD} | docker login -u ${DOCKERHUB_USER} --password-stdin
echo "Building controller images ..."
make clean-image build image image-chroot
echo "Building E2E image ..."
Expand All @@ -106,6 +113,8 @@ jobs:
name: controller-${{ env.ARCH }}.tar
path: controller-${{ env.ARCH }}.tar



smoke:
name: Smoke
runs-on: ${{ matrix.RUNNER }}
Expand Down Expand Up @@ -149,8 +158,8 @@ jobs:
kv-gitlab-ci/data/github/shared/allure allure_token ;
kv-gitlab-ci/data/github/shared/smoke-tests-registry-creds token_name ;
kv-gitlab-ci/data/github/shared/smoke-tests-registry-creds token_secret ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -164,7 +173,10 @@ jobs:
run: docker load -i controller-${{ env.ARCH }}.tar

- name: Login to DockerHub
run: echo ${{ steps.secrets.outputs.password }} | docker login -u ${{ steps.secrets.outputs.user }} --password-stdin
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Create cluster
run: kind create cluster --image=kindest/node:${{ matrix.k8s }}
Expand Down Expand Up @@ -192,6 +204,8 @@ jobs:
run: |
make kind-smoke-test
chart-testing:
name: Chart testing
runs-on: self-hosted-amd64-2cpu
Expand All @@ -217,8 +231,8 @@ jobs:
path: kubernetes-ci
secrets: |
kv-gitlab-ci/data/github/ingress api_token ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -234,7 +248,10 @@ jobs:
run: docker load -i controller-${{ env.ARCH }}.tar

- name: Login to DockerHub
run: echo ${{ steps.secrets.outputs.password }} | docker login -u ${{ steps.secrets.outputs.user }} --password-stdin
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Create cluster
run: kind create cluster --image=kindest/node:v1.25.8 --config test/e2e/kind.yaml
Expand All @@ -246,11 +263,15 @@ jobs:
SKIP_IMAGE_CREATION: true
WALLARM_API_TOKEN: ${{ steps.secrets.outputs.api_token }}
CT_MODE: ${{ matrix.method }}
DOCKERHUB_USER: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}
run: |
kind get kubeconfig > $GITHUB_WORKSPACE/kind-config-kind
export KUBECONFIG=$GITHUB_WORKSPACE/kind-config-kind
make kind-e2e-chart-tests
e2e:
name: E2E
runs-on: self-hosted-amd64-4cpu
Expand Down Expand Up @@ -282,11 +303,14 @@ jobs:
method: kubernetes
path: kubernetes-ci
secrets: |
kv-gitlab-ci/data/github/shared/dockerhub-creds user ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Login to DockerHub
run: echo ${{ steps.secrets.outputs.password }} | docker login -u ${{ steps.secrets.outputs.user }} --password-stdin
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Create cluster
run: kind create cluster --image=kindest/node:v1.25.8 --config test/e2e/kind.yaml
Expand All @@ -298,11 +322,14 @@ jobs:
SKIP_INGRESS_IMAGE_CREATION: true
SKIP_E2E_IMAGE_CREATION: true
ARCH: amd64
DOCKERHUB_USER: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-test
e2e-wallarm:
name: E2E - Wallarm
runs-on: self-hosted-amd64-4cpu
Expand Down Expand Up @@ -330,8 +357,8 @@ jobs:
secrets: |
kv-gitlab-ci/data/github/ingress api_token ;
kv-gitlab-ci/data/github/ingress api_host ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -345,7 +372,10 @@ jobs:
run: docker load -i controller-${{ env.ARCH }}.tar

- name: Login to DockerHub
run: echo ${{ steps.secrets.outputs.password }} | docker login -u ${{ steps.secrets.outputs.user }} --password-stdin
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Create cluster ${{ matrix.k8s }}
run: kind create cluster --image=kindest/node:${{ matrix.k8s }} --config test/e2e/kind.yaml
Expand All @@ -359,10 +389,14 @@ jobs:
WALLARM_ENABLED: true
WALLARM_API_TOKEN: ${{ steps.secrets.outputs.api_token }}
WALLARM_API_HOST: ${{ steps.secrets.outputs.api_host }}
DOCKERHUB_USER: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
DOCKERHUB_PASSWORD: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind
make E2E_NODES=7 kind-e2e-test
scan:
name: Scan images
runs-on: self-hosted-amd64-1cpu
Expand Down Expand Up @@ -393,11 +427,14 @@ jobs:
method: kubernetes
path: kubernetes-ci
secrets: |
kv-gitlab-ci/data/github/shared/dockerhub-creds user ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password ;
kv-gitlab-ci/data/github/shared/dockerhub-creds user | DOCKERHUB_USER ;
kv-gitlab-ci/data/github/shared/dockerhub-creds password | DOCKERHUB_PASSWORD ;
- name: Login to DockerHub
run: echo ${{ steps.secrets.outputs.password }} | docker login -u ${{ steps.secrets.outputs.user }} --password-stdin
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
username: ${{ steps.secrets.outputs.DOCKERHUB_USER }}
password: ${{ steps.secrets.outputs.DOCKERHUB_PASSWORD }}

- name: Scan controller image
uses: anchore/scan-action@3343887d815d7b07465f6fdcd395bd66508d486a
Expand Down
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/daemonset-customconfig-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ controller:
config:
use-proxy-protocol: "true"
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/daemonset-internal-lb-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ controller:
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deamonset-default-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ controller:
service:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deamonset-fallback-off-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ controller:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
fallback: "off"
fallback: "off"
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deamonset-fallback-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ controller:
type: ClusterIP
wallarm:
# Intentionally put wrong URL to check
apiHost: wrong_url.api.wallarm.com
apiHost: wrong_url.api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deamonset-metrics-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ controller:
wallarm:
apiHost: api.wallarm.com
metrics:
enabled: true
enabled: true
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deamonset-webhook-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ controller:
service:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ controller:
service:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ controller:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
fallback: "off"
fallback: "off"
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deployment-fallback-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ controller:
type: ClusterIP
wallarm:
# Intentionally put wrong URL to check
apiHost: wrong_url.api.wallarm.com
apiHost: wrong_url.api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deployment-headers-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ controller:
service:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deployment-metrics-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ controller:
wallarm:
apiHost: api.wallarm.com
metrics:
enabled: true
enabled: true
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deployment-nodeport-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ controller:
service:
type: NodePort
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ controller:
prometheus.io/scheme: http
prometheus.io/scrape: "true"
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ controller:
patch:
enabled: true
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ controller:
patch:
enabled: true
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
2 changes: 1 addition & 1 deletion charts/ingress-nginx/ci/deployment-webhook-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ controller:
service:
type: ClusterIP
wallarm:
apiHost: api.wallarm.com
apiHost: api.wallarm.com
Loading

0 comments on commit 98ade80

Please sign in to comment.