Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Use Proxy in CI #429

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
53 changes: 45 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,65 @@
version: 2.1

parameters:
machine_image:
type: string
default: ubuntu-2204:2023.04.2

commands:
start-minikube:
steps:
- run:
name: Start minikube
command: |
KUBE_VERSION="$(jq -r .kubernetes < version.json)"
minikube start --vm-driver=docker --kubernetes-version=${KUBE_VERSION} --wait=all

wait-for-pach:
steps:
- run:
name: Wait for pachyderm
command: |
kubectl wait --for=condition=available deployment -l app=pachd --timeout=5m
deploy-pachyderm:
steps:
- run:
name: Install dependencies
command: etc/testing/circle/install.sh
- run:
name: Start minikube
command: etc/testing/circle/start-minikube.sh
name: Add deps to path
command: |
echo 'export PATH=/home/circleci/project/cached-deps:$PATH' >> $BASH_ENV
- start-minikube
- run:
name: Deploy pachyderm
command: etc/testing/circle/deploy-pachyderm.sh
command: |
PACHYDERM_VERSION="$(jq -r .pachyderm version.json)"
helm repo add pachyderm https://pachyderm.github.io/helmchart
helm repo update
helm install pachd pachyderm/pachyderm --set deployTarget=LOCAL,proxy.service.type=NodePort --version ${PACHYDERM_VERSION}
- run:
name: Login to Pach
command: |
pachctl connect grpc://$(minikube ip):30080

install-python:
parameters:
version:
type: string
steps:
- restore_cache:
key: python-pach-pyenv-v1-<< parameters.version >>
- run:
name: Install python
command: |
git -C "/opt/circleci/.pyenv/" checkout master -q
git -C "/opt/circleci/.pyenv/" pull -q
pyenv install <<parameters.version>>
pyenv install -s <<parameters.version>>
pyenv global <<parameters.version>>
- save_cache:
key: python-pach-pyenv-v1-<< parameters.version >>
paths:
- /opt/circleci/.pyenv/versions/<< parameters.version >>

install-poetry:
steps:
Expand All @@ -49,20 +84,21 @@ jobs:
python-version:
type: string
machine:
image: ubuntu-2004:202111-01
image: << pipeline.parameters.machine_image >>
steps:
- checkout
- deploy-pachyderm
- install-python:
version: <<parameters.python-version>>
- install-poetry
- create-venv
- wait-for-pach
- run:
name: Run unit tests
command: |
pachctl port-forward &
mkdir -p test-results
poetry run pytest -v --junitxml=test-results/junit.xml tests
no_output_timeout: 20m
- store_test_results:
path: test-results
- store_artifacts:
Expand All @@ -77,19 +113,20 @@ jobs:
python-version:
type: string
machine:
image: ubuntu-2004:202111-01
image: << pipeline.parameters.machine_image >>
steps:
- checkout
- deploy-pachyderm
- install-python:
version: <<parameters.python-version>>
- install-poetry
- create-venv
- wait-for-pach
- run:
name: Run opencv example
command: |
pachctl port-forward &
poetry run python ./examples/opencv/opencv.py
no_output_timeout: 20m
- run:
when: on_fail
command: etc/testing/circle/kube_debug.sh
Expand Down
13 changes: 0 additions & 13 deletions etc/testing/circle/deploy-pachyderm.sh

This file was deleted.

27 changes: 11 additions & 16 deletions etc/testing/circle/install.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
#!/bin/bash

set -ex
set -euxo pipefail

ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then ARCH=arm64; fi

mkdir -p cached-deps

# Install deps
sudo apt update -y
sudo apt-get install -y -qq \
pkg-config \
conntrack \
pv \
jq \
socat

# Install Helm
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
# Install helm
if [ ! -f cached-deps/helm ]; then
HELM_VERSION=3.5.4
curl -L https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz \
| tar xzf - linux-${ARCH}/helm
mv ./linux-${ARCH}/helm cached-deps/helm
fi

# Install kubectl
# To get the latest kubectl version:
Expand Down
38 changes: 0 additions & 38 deletions etc/testing/circle/start-minikube.sh

This file was deleted.

2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"pachyderm": "2.6.0",
"kubernetes": "1.22.8",
"minikube": "1.25.2"
"minikube": "1.30.1"
}