CI: Add K3D CI test (#405)
- add testing with K3D cluster - bump backend image to python 3.10-slim for newer python, smaller image. - bump to 1.2.0-beta.0
This commit is contained in:
		
							parent
							
								
									a656ab512b
								
							
						
					
					
						commit
						2d93cef966
					
				
							
								
								
									
										94
									
								
								.github/workflows/k3d-ci.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										94
									
								
								.github/workflows/k3d-ci.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,94 @@
 | 
				
			|||||||
 | 
					name: Cluster Run (K3d)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on: [push, pull_request]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  btrix-k3d-test:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Create k3d Cluster
 | 
				
			||||||
 | 
					        uses: AbsaOSS/k3d-action@v2
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          cluster-name: btrix-1
 | 
				
			||||||
 | 
					          args: >-
 | 
				
			||||||
 | 
					            -p "30870:30870@agent:0:direct"
 | 
				
			||||||
 | 
					            --agents 1
 | 
				
			||||||
 | 
					            --no-lb
 | 
				
			||||||
 | 
					            --k3s-arg "--no-deploy=traefik,servicelb,metrics-server@server:*"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Set up Docker Buildx
 | 
				
			||||||
 | 
					        uses: docker/setup-buildx-action@v2
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          driver-opts: network=host
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Build Backend
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: backend
 | 
				
			||||||
 | 
					          load: true
 | 
				
			||||||
 | 
					          #outputs: type=tar,dest=backend.tar
 | 
				
			||||||
 | 
					          tags: webrecorder/browsertrix-backend:latest
 | 
				
			||||||
 | 
					          cache-from: type=gha,scope=backend
 | 
				
			||||||
 | 
					          cache-to: type=gha,scope=backend,mode=max
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Build Frontend
 | 
				
			||||||
 | 
					        uses: docker/build-push-action@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          context: frontend
 | 
				
			||||||
 | 
					          load: true
 | 
				
			||||||
 | 
					          #outputs: type=tar,dest=frontend.tar
 | 
				
			||||||
 | 
					          tags: webrecorder/browsertrix-frontend:latest
 | 
				
			||||||
 | 
					          cache-from: type=gha,scope=frontend
 | 
				
			||||||
 | 
					          cache-to: type=gha,scope=frontend,mode=max
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: "Import Images"
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          k3d image import webrecorder/browsertrix-backend:latest -m direct -c btrix-1 --verbose
 | 
				
			||||||
 | 
					          k3d image import webrecorder/browsertrix-frontend:latest -m direct -c btrix-1 --verbose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Install Kubectl
 | 
				
			||||||
 | 
					        uses: azure/setup-kubectl@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install Helm
 | 
				
			||||||
 | 
					        uses: azure/setup-helm@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					           version: 3.10.2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Start Cluster with Helm
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          helm upgrade --install -f ./chart/values.yaml -f ./chart/examples/k3d-ci.yaml btrix ./chart/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Install Python
 | 
				
			||||||
 | 
					        uses: actions/setup-python@v3
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: '3.9'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Install Python Libs
 | 
				
			||||||
 | 
					        run: pip install pytest requests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Wait for all pods to be ready
 | 
				
			||||||
 | 
					        run: kubectl wait --for=condition=ready pod --all --timeout=240s
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					      - 
 | 
				
			||||||
 | 
					        name: Run Tests
 | 
				
			||||||
 | 
					        run: py.test -vv ./backend/test/*.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -
 | 
				
			||||||
 | 
					        name: Print Backend Logs
 | 
				
			||||||
 | 
					        if: ${{ failure() }}
 | 
				
			||||||
 | 
					        run: kubectl logs svc/browsertrix-cloud-backend
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								.github/workflows/microk8s-ci.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/microk8s-ci.yaml
									
									
									
									
										vendored
									
									
								
							@ -1,4 +1,4 @@
 | 
				
			|||||||
name: Cluster Run (MicroK8S local)
 | 
					name: Cluster Run (MicroK8s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
on: [push, pull_request]
 | 
					on: [push, pull_request]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@ ARG PODMAN_VERSION=4
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
FROM docker.io/mgoltzsche/podman:${PODMAN_VERSION}-remote as podmanremote
 | 
					FROM docker.io/mgoltzsche/podman:${PODMAN_VERSION}-remote as podmanremote
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM docker.io/library/python:3.9
 | 
					FROM docker.io/library/python:3.10-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /app
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,2 +1,2 @@
 | 
				
			|||||||
""" current version """
 | 
					""" current version """
 | 
				
			||||||
__version__ = "1.1.0"
 | 
					__version__ = "1.2.0-beta.0"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								chart/examples/k3d-ci.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								chart/examples/k3d-ci.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					# k3s overrides for ci
 | 
				
			||||||
 | 
					# --------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# don't pull use, existing images
 | 
				
			||||||
 | 
					api_pull_policy: "Never"
 | 
				
			||||||
 | 
					nginx_pull_policy: "Never"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					superuser:
 | 
				
			||||||
 | 
					  # set this to enable a superuser admin
 | 
				
			||||||
 | 
					  email: admin@example.com
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # optional: if not set, automatically generated
 | 
				
			||||||
 | 
					  # change or remove this
 | 
				
			||||||
 | 
					  password: PASSW0RD!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local_service_port: 30870
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "browsertrix-frontend",
 | 
					  "name": "browsertrix-frontend",
 | 
				
			||||||
  "version": "1.1.0",
 | 
					  "version": "1.2.0-beta.0",
 | 
				
			||||||
  "main": "index.ts",
 | 
					  "main": "index.ts",
 | 
				
			||||||
  "license": "AGPL-3.0-or-later",
 | 
					  "license": "AGPL-3.0-or-later",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
1.1.0
 | 
					1.2.0-beta.0
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user