Skip to content

Commit

Permalink
End-to-end test improvements and fixed to Pulsar ingress/serviced code (
Browse files Browse the repository at this point in the history
#15)

* Pass through GOPROXY/GOPRIVATE from the host for make proto

* Removed commented-out code

* Open armadactl by relative path, use valid priority

* Refactoring, cleanup

* Added test submitting several jobs, more rigorous event comparison

* Removed test submitting only a single job

* Pulsar e2e test cleanup

* Added code for getting jobIds from events

* Remove GR-specific GOPROXY/GOPRIVATE

* Remove references to GR from proto build

* Todo, whitespace

* Test improvements

* Use same alpine image as for tests, set limits equal to requests (as required by Armada)

* Removed todos

* Disallow combining PodSpec and PodSpecs, dissallow PodSpecs

* Correctly create services and ingresses in log submit API

* Set name of objects to create from the ObjectMeta included with the SubmitJob message

* Comments

* Added todo

* Comments

* Todos

* Test jobs with services/ingresses

* Comments

* Use PodSpec instead of PodSpecs

* Fail immediately on failure to connect to db

* Convert PodSpecs with 1 entry to PodSpec

* Avoid panics, check for PodSpec instead of PodSpecs[0]

* Import ordering
  • Loading branch information
Albin Severinson authored and Gary Conway committed Mar 25, 2022
1 parent da32750 commit fdec84e
Show file tree
Hide file tree
Showing 26 changed files with 726 additions and 241 deletions.
2 changes: 0 additions & 2 deletions build/armada-load-tester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/armada/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/armadactl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/binoculars/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/executor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/fakeexecutor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
2 changes: 0 additions & 2 deletions build/lookout/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.10

# RUN apk update && apk add --no-cache ca-certificates

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada

USER armada
Expand Down
26 changes: 16 additions & 10 deletions build/proto/GR_build/Dockerfile → build/protogo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile for building .proto files internally at GR.
# Dockerfile for building .proto files (sans the dotnet stuff).

ARG GOLANG_VERSION=1.14
ARG PROTOC_VERSION=3.17.3
Expand All @@ -9,17 +9,25 @@ ARG GO_SWAGGER_VERSION=0.23.0
ARG TEMPLIFY_VERSION=0.0.0-20190823200653-c12e62ca00c1
ARG GOIMPORTS_VERSION=0.0.0-20200529172331-a64b76657301

# Populate with environment variables from shell by running docker build with
# --build-arg GOPROXY --build-arg GOPRIVATE
ARG GOPROXY=""
ARG GOPRIVATE=""

FROM --platform=linux/amd64 golang:${GOLANG_VERSION}-buster as builder

# Corporate proxy for go packages.
ENV GOPROXY=http://goproxy.uberit.net:3000
ENV GOPRIVATE=git.uberit.net
# Load GOPROXY and GOPRIVATE as environment varialbes in the build container.
# If not defined, these are set to "", which defaults to the standard go package source.
ARG GOPROXY
ARG GOPRIVATE
ENV GOPROXY=$GOPROXY
ENV GOPRIVATE=$GOPRIVATE

# Because we're building behind a corporate proxy,
# the protoc binaries have to be brought in manually via self-service downloads.
# Copy in the protoc toolchain (which must be downloaded and made available manually).
ARG PROTOC_VERSION
COPY build/proto/GR_build/protoc-${PROTOC_VERSION}-linux-x86_64/bin/protoc /usr/local/bin
COPY build/proto/GR_build/protoc-${PROTOC_VERSION}-linux-x86_64/include/* /proto
COPY build/protogo/protoc-${PROTOC_VERSION}-linux-x86_64/bin/protoc /usr/local/bin
COPY build/protogo/protoc-${PROTOC_VERSION}-linux-x86_64/include/* /proto
# Automated way of downloading protoc toolchain.
#RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
# unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local bin/protoc && \
# unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local include/* && \
Expand All @@ -46,8 +54,6 @@ RUN go mod download k8s.io/api@v${K8S_VERSION} && \
mkdir -p /proto/k8s.io/apimachinery && \
cp -r $(go env GOPATH)/pkg/mod/k8s.io/api@v${K8S_VERSION}/* /proto/k8s.io/api && \
cp -r $(go env GOPATH)/pkg/mod/k8s.io/apimachinery@v${K8S_VERSION}/* /proto/k8s.io/apimachinery
#RUN git clone --branch v${K8S_VERSION} https://github.com/kubernetes/api /proto/k8s.io/api && \
# git clone --branch v${K8S_VERSION} https://github.com/kubernetes/apimachinery /proto/k8s.io/apimachinery

ARG GO_SWAGGER_VERSION
RUN GO111MODULE=on go get github.com/go-swagger/go-swagger/cmd/swagger@v${GO_SWAGGER_VERSION}
Expand Down
6 changes: 3 additions & 3 deletions cmd/armada-load-tester/cmd/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ var loadtestCmd = &cobra.Command{
containers:
- name: sleep
imagePullPolicy: IfNotPresent
image: alpine:latest
image: alpine:3.10
command:
- sh
args:
- -c
- sleep $(( (RANDOM % 60) + 100 ))
resources:
limits:
memory: 128Mi
cpu: 80m
memory: 64Mi
cpu: 60m
requests:
memory: 64Mi
cpu: 60m
Expand Down
8 changes: 1 addition & 7 deletions e2e/setup/pulsar/armada-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,4 @@ pulsar:
redisFromPulsarSubscription: "RedisFromPulsar"
pulsarFromPulsarSubscription: "PulsarFromPulsar"
hostnameSuffix: "svc"
certNameSuffix: "ingress-tls-certificate"
# TODO:
# compression
# tls
# ca, path to
# jwt, if enabled
# jwt, path to token file
certNameSuffix: "ingress-tls-certificate"
8 changes: 6 additions & 2 deletions e2e/test/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (

const integrationEnabledEnvVar = "INTEGRATION_ENABLED"

// Location of the armadactl executable, which is needed by some tests.
// Path is relative to this file.
const armadactlExecutable = "../../bin/armadactl"

func TestCanSubmitJob_ReceivingAllExpectedEvents(t *testing.T) {
skipIfIntegrationEnvNotPresent(t)

Expand Down Expand Up @@ -96,7 +100,7 @@ func TestCanSubmitJob_ArmdactlWatchExitOnInactive(t *testing.T) {
jobRequest := createJobRequest("personal-anonymous")
createQueue(submitClient, jobRequest, t)

cmd := exec.Command("armadactl", "--armadaUrl="+connDetails.ArmadaUrl, "watch", "--exit-if-inactive", jobRequest.Queue, jobRequest.JobSetId)
cmd := exec.Command(armadactlExecutable, "--armadaUrl="+connDetails.ArmadaUrl, "watch", "--exit-if-inactive", jobRequest.Queue, jobRequest.JobSetId)
err := cmd.Start()
assert.NoError(t, err)

Expand Down Expand Up @@ -202,7 +206,7 @@ func createJobRequest(namespace string) *api.JobSubmitRequest {
},
},
},
Priority: 0,
Priority: 1,
},
},
}
Expand Down
Loading

0 comments on commit fdec84e

Please sign in to comment.