Skip to content

Commit

Permalink
build(e2e): check node image exists in registry
Browse files Browse the repository at this point in the history
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
1 parent 99e6d87 commit 64b7f37
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
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
9 changes: 6 additions & 3 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 All @@ -50,7 +52,7 @@ endif
.PHONY: kube-prepare-images
kube-prepare-images:
ifneq ($(SKIP_BUILD), true)
make -C $(AP_ROOT) docker-image
# make -C $(AP_ROOT) docker-image
ifeq ($(AKASH_BUILD_LOCAL_IMAGE), true)
make -C $(AKASH_LOCAL_PATH) docker-image
else
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

0 comments on commit 64b7f37

Please sign in to comment.