Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/deployments/just: add e2e, various improvements to just targets #69

Merged
merged 15 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/e2e_simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: e2e test simple

on:
workflow_dispatch:
inputs:
skip-undeploy:
description: "Skip undeploy"
required: false
default: "false"
pull_request:

env:
container_registry: ghcr.io/edgelesssys
azure_resource_group: nunki-ci

jobs:
test:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: DeterminateSystems/magic-nix-cache-action@8a218f9e264e9c3803c9a1ee1c30d8e4ab55be63 #v2
- name: Log in to ghcr.io Container registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Azure
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
with:
creds: ${{ secrets.NUNKI_CI_INFRA_AZURE }}
- uses: nicknovitski/nix-develop@a2060d116a50b36dfab02280af558e73ab52427d # v1.1.0
- name: Generate namespace suffix
id: ns
run: |
uuid=$(cat /proc/sys/kernel/random/uuid)
uid=${uuid##*-}
echo "namespace_suffix=$uid" >> "$GITHUB_OUTPUT"
- name: Create justfile.env
run: |
cat <<EOF > justfile.env
container_registry=${{ env.container_registry }}
azure_resource_group=${{ env.azure_resource_group }}
namespace_suffix=-${{ steps.ns.outputs.namespace_suffix }}
EOF
- name: Get credentials for CI cluster
run: |
just get-credentials
- name: Build, deploy, nunki generate, nunki set, nunki verify
run: |
just default simple
- name: Summary
run: |
cat ./workspace/just.namespace | tee -a "${GITHUB_STEP_SUMMARY}"
cat ./workspace/just.perf | tee -a "${GITHUB_STEP_SUMMARY}"
- name: Undeploy
if: always() && inputs.skip-undeploy != 'true'
run: |
just undeploy
4 changes: 2 additions & 2 deletions deployments/emojivoto/coordinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: coordinator
namespace: edg-emojivoto
namespace: edg-default
spec:
selector:
matchLabels:
Expand Down Expand Up @@ -33,7 +33,7 @@ apiVersion: v1
kind: Service
metadata:
name: coordinator
namespace: edg-emojivoto
namespace: edg-default
spec:
ports:
- name: intercom
Expand Down
8 changes: 4 additions & 4 deletions deployments/emojivoto/emoji.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ kind: ServiceAccount
apiVersion: v1
metadata:
name: emoji
namespace: edg-emojivoto
namespace: edg-default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: emoji
namespace: edg-emojivoto
namespace: edg-default
labels:
app.kubernetes.io/name: emoji
app.kubernetes.io/part-of: emojivoto
Expand All @@ -32,7 +32,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-emojivoto
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand Down Expand Up @@ -71,7 +71,7 @@ apiVersion: v1
kind: Service
metadata:
name: emoji-svc
namespace: edg-emojivoto
namespace: edg-default
spec:
selector:
app: emoji-svc
Expand Down
2 changes: 1 addition & 1 deletion deployments/emojivoto/ns.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: edg-emojivoto
name: edg-default
10 changes: 5 additions & 5 deletions deployments/emojivoto/portforwarder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-coordinator
namespace: default
namespace: edg-default
spec:
containers:
- name: port-forwarder
Expand All @@ -11,7 +11,7 @@ spec:
- name: LISTEN_PORT
value: "1313"
- name: FORWARD_HOST
value: coordinator.edg-emojivoto
value: coordinator
- name: FORWARD_PORT
value: "1313"
command:
Expand All @@ -24,8 +24,8 @@ spec:
apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-2
namespace: default
name: port-forwarder-emojivoto-web
namespace: edg-default
spec:
containers:
- name: port-forwarder
Expand All @@ -34,7 +34,7 @@ spec:
- name: LISTEN_PORT
value: "8080"
- name: FORWARD_HOST
value: web-svc.edg-emojivoto
value: web-svc
- name: FORWARD_PORT
value: "443"
command:
Expand Down
4 changes: 2 additions & 2 deletions deployments/emojivoto/vote-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-bot
namespace: edg-emojivoto
namespace: edg-default
labels:
app.kubernetes.io/name: vote-bot
app.kubernetes.io/part-of: emojivoto
Expand All @@ -24,7 +24,7 @@ spec:
- emojivoto-vote-bot
env:
- name: WEB_HOST
value: web-svc.edg-emojivoto:443
value: web-svc:443
image: ghcr.io/3u13r/emojivoto-web:coco-1
imagePullPolicy: Always
name: vote-bot
Expand Down
8 changes: 4 additions & 4 deletions deployments/emojivoto/voting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ kind: ServiceAccount
apiVersion: v1
metadata:
name: voting
namespace: edg-emojivoto
namespace: edg-default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: voting
namespace: edg-emojivoto
namespace: edg-default
labels:
app.kubernetes.io/name: voting
app.kubernetes.io/part-of: emojivoto
Expand All @@ -32,7 +32,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-emojivoto
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand Down Expand Up @@ -71,7 +71,7 @@ apiVersion: v1
kind: Service
metadata:
name: voting-svc
namespace: edg-emojivoto
namespace: edg-default
spec:
selector:
app: voting-svc
Expand Down
12 changes: 6 additions & 6 deletions deployments/emojivoto/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ kind: ServiceAccount
apiVersion: v1
metadata:
name: web
namespace: edg-emojivoto
namespace: edg-default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: edg-emojivoto
namespace: edg-default
labels:
app.kubernetes.io/name: web
app.kubernetes.io/part-of: emojivoto
Expand All @@ -32,7 +32,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-emojivoto
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand All @@ -42,9 +42,9 @@ spec:
- name: WEB_PORT
value: "8080"
- name: EMOJISVC_HOST
value: emoji-svc.edg-emojivoto:8080
value: emoji-svc:8080
- name: VOTINGSVC_HOST
value: voting-svc.edg-emojivoto:8080
value: voting-svc:8080
- name: INDEX_BUNDLE
value: dist/index_bundle.js
- name: EDG_CERT_PATH
Expand Down Expand Up @@ -75,7 +75,7 @@ apiVersion: v1
kind: Service
metadata:
name: web-svc
namespace: edg-emojivoto
namespace: edg-default
spec:
type: ClusterIP
selector:
Expand Down
4 changes: 2 additions & 2 deletions deployments/openssl/coordinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: coordinator
namespace: edg-openssl
namespace: edg-default
spec:
selector:
matchLabels:
Expand Down Expand Up @@ -33,7 +33,7 @@ apiVersion: v1
kind: Service
metadata:
name: coordinator
namespace: edg-openssl
namespace: edg-default
spec:
ports:
- name: intercom
Expand Down
4 changes: 2 additions & 2 deletions deployments/openssl/initializer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: workload
namespace: edg-openssl
namespace: edg-default
spec:
selector:
matchLabels:
Expand All @@ -20,7 +20,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-openssl
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand Down
2 changes: 1 addition & 1 deletion deployments/openssl/ns.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: edg-openssl
name: edg-default
6 changes: 3 additions & 3 deletions deployments/openssl/openssl-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: openssl-backend
namespace: edg-openssl
namespace: edg-default
spec:
selector:
matchLabels:
Expand All @@ -20,7 +20,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-openssl
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand Down Expand Up @@ -48,7 +48,7 @@ apiVersion: v1
kind: Service
metadata:
name: openssl-backend
namespace: edg-openssl
namespace: edg-default
spec:
selector:
run: openssl-backend
Expand Down
4 changes: 2 additions & 2 deletions deployments/openssl/openssl-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: openssl-client
namespace: edg-openssl
namespace: edg-default
spec:
selector:
matchLabels:
Expand All @@ -20,7 +20,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-openssl
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand Down
6 changes: 3 additions & 3 deletions deployments/openssl/openssl-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: openssl-frontend
namespace: edg-openssl
namespace: edg-default
spec:
selector:
matchLabels:
Expand All @@ -20,7 +20,7 @@ spec:
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator.edg-openssl
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
Expand All @@ -43,7 +43,7 @@ apiVersion: v1
kind: Service
metadata:
name: openssl-frontend
namespace: edg-openssl
namespace: edg-default
spec:
selector:
run: openssl-frontend
Expand Down
4 changes: 2 additions & 2 deletions deployments/openssl/portforwarder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-coordinator
namespace: default
namespace: edg-default
spec:
containers:
- name: port-forwarder
Expand All @@ -11,7 +11,7 @@ spec:
- name: LISTEN_PORT
value: "1313"
- name: FORWARD_HOST
value: coordinator.edg-openssl
value: coordinator
- name: FORWARD_PORT
value: "1313"
command:
Expand Down
Loading