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

e2e: support docker hub as registry #1489

Merged
merged 3 commits into from
Dec 8, 2022
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
14 changes: 7 additions & 7 deletions .github/workflows/e2e-test-ci-v2-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ jobs:

echo "creating images cache..."
docker save \
localhost:5000/apache/apisix:dev \
localhost:5000/bitnami/etcd:dev \
localhost:5000/apache/apisix-ingress-controller:dev \
localhost:5000/kennethreitz/httpbin:dev \
localhost:5000/test-backend:dev \
localhost:5000/jmalloc/echo-server:dev \
localhost:5000/busybox:dev \
${REGISTRY}/apisix:dev \
${REGISTRY}/etcd:dev \
${REGISTRY}/apisix-ingress-controller:dev \
${REGISTRY}/httpbin:dev \
${REGISTRY}/test-backend:dev \
${REGISTRY}/echo-server:dev \
${REGISTRY}/busybox:dev \
| pigz > docker-v2.tar.gz

- name: cache
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/e2e-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ jobs:

echo "creating images cache..."
docker save \
localhost:5000/apache/apisix:dev \
localhost:5000/bitnami/etcd:dev \
localhost:5000/apache/apisix-ingress-controller:dev \
localhost:5000/kennethreitz/httpbin:dev \
localhost:5000/test-backend:dev \
localhost:5000/jmalloc/echo-server:dev \
localhost:5000/busybox:dev \
${REGISTRY}/apisix:dev \
${REGISTRY}/etcd:dev \
${REGISTRY}/apisix-ingress-controller:dev \
${REGISTRY}/httpbin:dev \
${REGISTRY}/test-backend:dev \
${REGISTRY}/echo-server:dev \
${REGISTRY}/busybox:dev \
| pigz > docker.tar.gz

- name: cache
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/k8s-timer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ jobs:

echo "creating images cache..."
docker save \
localhost:5000/apache/apisix:dev \
localhost:5000/bitnami/etcd:dev \
localhost:5000/apache/apisix-ingress-controller:dev \
localhost:5000/kennethreitz/httpbin:dev \
localhost:5000/test-backend:dev \
localhost:5000/jmalloc/echo-server:dev \
localhost:5000/busybox:dev \
${REGISTRY}/apisix:dev \
${REGISTRY}/etcd:dev \
${REGISTRY}/apisix-ingress-controller:dev \
${REGISTRY}/httpbin:dev \
${REGISTRY}/test-backend:dev \
${REGISTRY}/echo-server:dev \
${REGISTRY}/busybox:dev \
| pigz > docker.tar.gz

- name: cache
Expand Down
38 changes: 19 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ build:
### clean-image: clean apisix-ingress-controller image
.PHONY: clean-image
clean-image: ## Removes local image
echo "removing old image $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)"
docker rmi -f $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG) || true
echo "removing old image $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG)"
docker rmi -f $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG) || true

### build-image: Build apisix-ingress-controller image
.PHONY: build-image
build-image:
ifeq ($(E2E_SKIP_BUILD), 0)
docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG) --build-arg ENABLE_PROXY=$(ENABLE_PROXY) .
docker tag apache/apisix-ingress-controller:$(IMAGE_TAG) $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
docker tag apache/apisix-ingress-controller:$(IMAGE_TAG) $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG)
endif

### pack-image: Build and push Ingress image used in e2e test suites to kind or custom registry.
.PHONY: pack-image
pack-image: build-image
docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
docker push $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG)

### pack-images: Build and push images used in e2e test suites to kind or custom registry.
.PHONY: pack-images
Expand All @@ -90,21 +90,21 @@ pack-images: build-images push-images
build-images: build-image
ifeq ($(E2E_SKIP_BUILD), 0)
docker pull apache/apisix:$(TARGET_APISIX_VERSION)
docker tag apache/apisix:$(TARGET_APISIX_VERSION) $(REGISTRY)/apache/apisix:$(IMAGE_TAG)
docker tag apache/apisix:$(TARGET_APISIX_VERSION) $(REGISTRY)/apisix:$(IMAGE_TAG)

docker pull bitnami/etcd:3.4.14-debian-10-r0
docker tag bitnami/etcd:3.4.14-debian-10-r0 $(REGISTRY)/bitnami/etcd:$(IMAGE_TAG)
docker tag bitnami/etcd:3.4.14-debian-10-r0 $(REGISTRY)/etcd:$(IMAGE_TAG)

docker pull kennethreitz/httpbin
docker tag kennethreitz/httpbin $(REGISTRY)/kennethreitz/httpbin:$(IMAGE_TAG)
docker tag kennethreitz/httpbin $(REGISTRY)/httpbin:$(IMAGE_TAG)

docker build -t test-backend:$(IMAGE_TAG) --build-arg ENABLE_PROXY=$(ENABLE_PROXY) ./test/e2e/testbackend
docker tag test-backend:$(IMAGE_TAG) $(REGISTRY)/test-backend:$(IMAGE_TAG)

docker tag apache/apisix-ingress-controller:$(IMAGE_TAG) $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
docker tag apache/apisix-ingress-controller:$(IMAGE_TAG) $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG)

docker pull jmalloc/echo-server:latest
docker tag jmalloc/echo-server:latest $(REGISTRY)/jmalloc/echo-server:$(IMAGE_TAG)
docker tag jmalloc/echo-server:latest $(REGISTRY)/echo-server:$(IMAGE_TAG)

docker pull busybox:1.28
docker tag busybox:1.28 $(REGISTRY)/busybox:$(IMAGE_TAG)
Expand All @@ -114,12 +114,12 @@ endif
.PHONY: push-images
push-images:
ifeq ($(E2E_SKIP_BUILD), 0)
docker push $(REGISTRY)/apache/apisix:$(IMAGE_TAG)
docker push $(REGISTRY)/bitnami/etcd:$(IMAGE_TAG)
docker push $(REGISTRY)/kennethreitz/httpbin:$(IMAGE_TAG)
docker push $(REGISTRY)/apisix:$(IMAGE_TAG)
docker push $(REGISTRY)/etcd:$(IMAGE_TAG)
docker push $(REGISTRY)/httpbin:$(IMAGE_TAG)
docker push $(REGISTRY)/test-backend:$(IMAGE_TAG)
docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
docker push $(REGISTRY)/jmalloc/echo-server:$(IMAGE_TAG)
docker push $(REGISTRY)/apisix-ingress-controller:$(IMAGE_TAG)
docker push $(REGISTRY)/echo-server:$(IMAGE_TAG)
docker push $(REGISTRY)/busybox:$(IMAGE_TAG)
endif

Expand Down Expand Up @@ -270,12 +270,12 @@ endif
.PHONY: kind-load-images
kind-load-images:
kind load docker-image --name=apisix \
$(REGISTRY)/apache/apisix:dev \
$(REGISTRY)/bitnami/etcd:dev \
$(REGISTRY)/apache/apisix-ingress-controller:dev \
$(REGISTRY)/kennethreitz/httpbin:dev \
$(REGISTRY)/apisix:dev \
$(REGISTRY)/etcd:dev \
$(REGISTRY)/apisix-ingress-controller:dev \
$(REGISTRY)/httpbin:dev \
$(REGISTRY)/test-backend:dev \
$(REGISTRY)/jmalloc/echo-server:dev \
$(REGISTRY)/echo-server:dev \
$(REGISTRY)/busybox:dev


Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scaffold/apisix.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
tcpSocket:
port: 9080
timeoutSeconds: 2
image: "localhost:5000/apache/apisix:dev"
image: "localhost:5000/apisix:dev"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add a global variable that stores the $REGISTRY used instead of hardcoding it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imagePullPolicy: IfNotPresent
name: apisix-deployment-e2e-test
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scaffold/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
tcpSocket:
port: 2379
timeoutSeconds: 2
image: "localhost:5000/bitnami/etcd:dev"
image: "localhost:5000/etcd:dev"
imagePullPolicy: IfNotPresent
name: etcd-deployment-e2e-test
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scaffold/httpbin.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
tcpSocket:
port: 80
timeoutSeconds: 2
image: "localhost:5000/kennethreitz/httpbin:dev"
image: "localhost:5000/httpbin:dev"
imagePullPolicy: IfNotPresent
name: httpbin-deployment-e2e-test
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scaffold/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
image: "localhost:5000/apache/apisix-ingress-controller:dev"
image: "localhost:5000/apisix-ingress-controller:dev"
imagePullPolicy: IfNotPresent
name: ingress-apisix-controller-deployment-e2e-test
ports:
Expand Down
8 changes: 3 additions & 5 deletions test/e2e/scaffold/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ func NewScaffold(o *Options) *Scaffold {
}
if o.APISIXAdminAPIVersion == "" {
adminVersion := os.Getenv("APISIX_ADMIN_API_VERSION")
log.Errorw("admin api version")
if adminVersion == "v3" {
o.APISIXAdminAPIVersion = "v3"
if adminVersion != "" {
o.APISIXAdminAPIVersion = adminVersion
} else {
// fallback to v2
o.APISIXAdminAPIVersion = "v2"
o.APISIXAdminAPIVersion = "v3"
}
}
if o.APISIXConfigPath == "" {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/suite-annotations/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ metadata:
spec:
containers:
- name: websocket-server
image: localhost:5000/jmalloc/echo-server:dev
image: localhost:5000/echo-server:dev
ports:
- containerPort: 8080
---
Expand Down Expand Up @@ -126,7 +126,7 @@ metadata:
spec:
containers:
- name: websocket-server
image: localhost:5000/jmalloc/echo-server:dev
image: localhost:5000/echo-server:dev
ports:
- containerPort: 8080
---
Expand Down Expand Up @@ -210,7 +210,7 @@ metadata:
spec:
containers:
- name: websocket-server
image: localhost:5000/jmalloc/echo-server:dev
image: localhost:5000/echo-server:dev
ports:
- containerPort: 8080
---
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite-features/external-sd.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ spec:
tcpSocket:
port: 80
timeoutSeconds: 2
image: "localhost:5000/kennethreitz/httpbin:dev"
image: "localhost:5000/httpbin:dev"
imagePullPolicy: IfNotPresent
name: httpbin
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite-features/external-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ spec:
tcpSocket:
port: 80
timeoutSeconds: 2
image: "localhost:5000/kennethreitz/httpbin:dev"
image: "localhost:5000/httpbin:dev"
imagePullPolicy: IfNotPresent
name: httpbin
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite-features/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ metadata:
spec:
containers:
- name: websocket-server
image: localhost:5000/jmalloc/echo-server:dev
image: localhost:5000/echo-server:dev
ports:
- containerPort: 8080
---
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite-gateway/gateway_httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ spec:
spec:
containers:
- name: echo
image: localhost:5000/jmalloc/echo-server:dev
image: localhost:5000/echo-server:dev
ports:
- containerPort: 8080
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ spec:
tcpSocket:
port: 80
timeoutSeconds: 2
image: "localhost:5000/kennethreitz/httpbin:dev"
image: "localhost:5000/httpbin:dev"
imagePullPolicy: IfNotPresent
name: httpbin-temp
ports:
Expand Down