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

build(e2e): check node image exists in registry #126

Merged
merged 1 commit into from
Jun 22, 2023
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
build(e2e): check node image exists in registry
node release might be on the way and e2e test will fail
as container is being built. to resolve the issue
we check if image exists remotely, and if not
build it locally

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Jun 22, 2023
commit 42ad19e60e538061b77f0a9328a892ef99d2492e
8 changes: 8 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
env:
KUBE_SSH_NODE_NAME: kind

defaults:
run:
shell: bash

jobs:
crd-e2e:
env:
Expand All @@ -25,6 +29,10 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Go mod tidy
run: go mod tidy
- name: Make node scripts executable
run: make chmod-node-scripts
- name: Prepare images
run: make -s -C _run/kube kube-prepare-images
- uses: engineerd/[email protected]
Expand Down
7 changes: 5 additions & 2 deletions _run/common-kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ ifeq ($(AKASH_SRC_IS_LOCAL), true)
else
AKASH_BUILD_LOCAL_IMAGE := false
AKASH_DOCKER_IMAGE ?= ghcr.io/akash-network/node:$(AKASH_VERSION)-$(KUBE_DOCKER_IMAGE_ARCH)
ifeq ($(docker inspect --type=image $(AKASH_DOCKER_IMAGE) >/dev/null 2>&1), 1)
AKASH_DOCKER_IMAGE_EXISTS := $(shell docker inspect --type=image $(AKASH_DOCKER_IMAGE) >/dev/null 2>&1 && echo true || echo false)
ifeq ($(shell $(AKASH_DOCKER_IMAGE_EXISTS)), false)
AKASH_DOCKER_IMAGE := $(AKASH_LOCAL_DOCKER_IMAGE)
AKASH_BUILD_LOCAL_IMAGE := true
AKASH_LOCAL_PATH := $(AP_ROOT)/vendor/$(NODE_MODULE)
endif

undefine AKASH_DOCKER_IMAGE_EXISTS
endif

DOCKER_IMAGE ?= ghcr.io/akash-network/provider:latest-$(KUBE_DOCKER_IMAGE_ARCH)
Expand Down Expand Up @@ -101,6 +103,7 @@ kube-cluster-setup-e2e: $(KUBE_CREATE) kube-cluster-setup-e2e-ci
# dedicated target to perform setup within Github Actions CI
.PHONY: kube-cluster-setup-e2e-ci
kube-cluster-setup-e2e-ci: \
kube-prepare-images \
kube-setup-ingress \
kube-upload-images \
kustomize-init \
Expand Down
8 changes: 2 additions & 6 deletions make/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ endif
BINS := $(PROVIDER_SERVICES) akash

GOWORK ?= on

GO_MOD ?= vendor
ifeq ($(GOWORK), on)
GO_MOD := readonly
endif
GO_MOD ?= readonly

export GO := GO111MODULE=$(GO111MODULE) go
GO_BUILD := $(GO) build -mod=$(GO_MOD)
Expand All @@ -71,7 +67,7 @@ GO_MOD_NAME := $(shell go list -m 2>/dev/null)
NODE_MODULE := github.com/akash-network/node
REPLACED_MODULES := $(shell go list -mod=readonly -m -f '{{ .Replace }}' all 2>/dev/null | grep -v -x -F "<nil>" | grep "^/")
AKASH_SRC_IS_LOCAL := $(shell $(ROOT_DIR)/script/is_local_gomod.sh "$(NODE_MODULE)")
AKASH_LOCAL_PATH := $(shell $(GO) list -mod=readonly -m -f '{{ .Replace }}' "$(NODE_MODULE)")
AKASH_LOCAL_PATH := $(shell $(GO) list -mod=readonly -m -f '{{ .Dir }}' "$(NODE_MODULE)")
AKASH_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' $(NODE_MODULE) | cut -c2-)
GRPC_GATEWAY_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .Version }}' github.com/grpc-ecosystem/grpc-gateway)
GOLANGCI_LINT_VERSION ?= v1.51.2
Expand Down
4 changes: 4 additions & 0 deletions make/releasing.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ docgen: $(PROVIRER_DEVCACHE)
install:
$(GO) install $(BUILD_FLAGS) ./cmd/provider-services

.PHONY: chmod-node-scripts
chmod-node-scripts:
find "$(AKASH_LOCAL_PATH)/script" -type f -name '*.sh' -exec echo "chmod +x {}" \; -exec chmod +x {} \;

.PHONY: docker-image
docker-image:
docker run \
Expand Down