Skip to content
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
82 changes: 3 additions & 79 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: End-to-end tests
on:
workflow_dispatch:
inputs:
rev:
required: true
default: ""
type: string
pull_request:
branches:
- main
Expand All @@ -14,78 +9,7 @@ jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: jumpstarter-dev/jumpstarter-e2e@main
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Install python
run: uv python install 3.12

- name: Install jumpstarter
run: |
if [ -z "${{ inputs.rev }}" ]; then
REV="main"
else
REV="${{ inputs.rev }}"
fi
uv tool install "git+https://github.com/jumpstarter-dev/jumpstarter.git@$REV"

- name: Run make deploy
run: make deploy

- name: Create client
run: |
mkdir -p ~/.config/jumpstarter/clients
go run ./cmd/jmpctl/main.go client create test-client-1 > ~/.config/jumpstarter/clients/test-client-1.yaml
cat <<EOF >> ~/.config/jumpstarter/clients/test-client-1.yaml
drivers:
allow: []
unsafe: True
EOF

- name: Create exporter
run: |
sudo mkdir -p /etc/jumpstarter/exporters
sudo chown $USER /etc/jumpstarter/exporters

go run ./cmd/jmpctl/main.go exporter create test-exporter-1 > /etc/jumpstarter/exporters/test-exporter-1.yaml
cat <<EOF >> /etc/jumpstarter/exporters/test-exporter-1.yaml
export:
power:
type: jumpstarter.drivers.power.driver.MockPower
EOF
kubectl -n default patch exporters.jumpstarter.dev test-exporter-1 \
--type=merge --patch '{"metadata":{"labels":{"example.com/board":"rpi4"}}}'

go run ./cmd/jmpctl/main.go exporter create test-exporter-2 > /etc/jumpstarter/exporters/test-exporter-2.yaml
cat <<EOF >> /etc/jumpstarter/exporters/test-exporter-2.yaml
export:
storage:
type: jumpstarter.drivers.storage.driver.MockStorageMux
EOF
kubectl -n default patch exporters.jumpstarter.dev test-exporter-2 \
--type=merge --patch '{"metadata":{"labels":{"example.com/board":"rpi5"}}}'

- name: Run jumpstarter
run: |
export JUMPSTARTER_GRPC_INSECURE=1

jmp list
jmp-exporter list

jmp-exporter run test-exporter-1 &
jmp-exporter run test-exporter-2 &

sleep 5

jmp shell test-client-1 --label example.com/board rpi4 <<EOF
j power
EOF

jmp shell test-client-1 --label example.com/board rpi5 <<EOF
j storage
EOF
controller-ref: ${{ github.ref }}
jumpstarter-ref: main
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: ko-build cluster
deploy: ko-build cluster grpcurl
./hack/deploy_with_helm.sh

.PHONY: deploy-exporters
Expand Down Expand Up @@ -152,6 +152,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
KIND = $(LOCALBIN)/kind-$(KIND_VERSION)
KO = $(LOCALBIN)/ko-$(KO_VERSION)
GRPCURL = $(LOCALBIN)/grpcurl-$(GRPCURL_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.4.1
Expand All @@ -160,6 +161,7 @@ ENVTEST_VERSION ?= release-0.18
GOLANGCI_LINT_VERSION ?= v1.61.0
KIND_VERSION ?= v0.23.0
KO_VERSION ?= v0.17.0
GRPCURL_VERSION ?= v1.9.2

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand All @@ -186,6 +188,11 @@ ko: $(KO) ## Download ko locally if necessary.
$(KO): $(LOCALBIN)
$(call go-install-tool,$(KO),github.com/google/ko,$(KO_VERSION))

.PHONY: grpcurl
grpcurl: $(GRPCURL) ## Download grpcurl locally if necessary.
$(GRPCURL): $(LOCALBIN)
$(call go-install-tool,$(GRPCURL),github.com/fullstorydev/grpcurl/cmd/grpcurl,$(GRPCURL_VERSION))

.PHONY: helm-lint
helm-lint:
helm lint ./deploy/helm/jumpstarter/
Expand Down
3 changes: 2 additions & 1 deletion hack/deploy_with_helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -eo pipefail
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"

KIND=${KIND:-bin/kind-v0.23.0}
GRPCURL=${GRPCURL:-bin/grpcurl-v1.9.2}
IMG=${IMG:-quay.io/jumpstarter-dev/jumpstarter-controller:latest}
INGRESS_ENABLED=${INGRESS_ENABLED:-false}

Expand Down Expand Up @@ -108,7 +109,7 @@ echo -e "${GREEN}Waiting for grpc endpoints to be ready:${NC}"
for ep in ${GRPC_ENDPOINT} ${GRPC_ROUTER_ENDPOINT}; do
RETRIES=30
echo -e "${GREEN} * Checking ${ep} ... ${NC}"
while ! podman run docker.io/fullstorydev/grpcurl -insecure ${ep} list; do
while ! ${GRPCURL} -insecure ${ep} list; do
sleep 2
RETRIES=$((RETRIES-1))
if [ ${RETRIES} -eq 0 ]; then
Expand Down
Loading