Skip to content

Commit

Permalink
Merging master into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafai-gr committed Jun 25, 2024
2 parents cdb6c83 + 09e1a12 commit 44f7703
Show file tree
Hide file tree
Showing 102 changed files with 2,027 additions and 405 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ dockers:
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.base.name=alpine:3.18.3
- --label=org.opencontainers.image.base.name=alpine:3.20.1
- --label=org.opencontainers.image.licenses=Apache-2.0
- --label=org.opencontainers.image.vendor=G-Research
ids:
Expand Down
2 changes: 1 addition & 1 deletion build/armada-load-tester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/armada/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/armadactl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/binoculars/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/eventingester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/executor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/fakeexecutor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/jobservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/lookoutingesterv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/lookoutv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/scheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/scheduleringester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build/testsuite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.3
FROM alpine:3.20.1

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

Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/armadactl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1
FROM ${BASE_IMAGE}

LABEL org.opencontainers.image.title=armadactl
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/binoculars/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=binoculars
LABEL org.opencontainers.image.description="binoculars"
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/bundles/armada/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=armada
LABEL org.opencontainers.image.description="Armada Bundle"
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/bundles/full/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG NODE_BUILD_IMAGE=node:16.14-buster
ARG OPENAPI_BUILD_IMAGE=openapitools/openapi-generator-cli:v5.4.0
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${OPENAPI_BUILD_IMAGE} AS OPENAPI
LABEL org.opencontainers.image.title=armada-full-bundle
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/bundles/lookout/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=armada-lookout-bundle
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/eventingester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.5
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=eventingester
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/executor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=executor
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/fakeexecutor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=fakeexecutor
LABEL org.opencontainers.image.description="Fake Executor"
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/jobservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=jobservice
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/loadtester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=loadtester
Expand Down
4 changes: 2 additions & 2 deletions build_goreleaser/lookoutingesterv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=lookoutingesterv2
Expand All @@ -13,4 +13,4 @@ COPY config/lookoutingesterv2/config.yaml /app/config/lookoutingesterv2/config.y

WORKDIR /app

ENTRYPOINT ["./lookoutingesterv2"]
ENTRYPOINT ["./lookoutingesterv2"]
2 changes: 1 addition & 1 deletion build_goreleaser/lookoutv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG NODE_BUILD_IMAGE=node:16.14-buster
ARG OPENAPI_BUILD_IMAGE=openapitools/openapi-generator-cli:v5.4.0
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${OPENAPI_BUILD_IMAGE} AS OPENAPI

Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/scheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=scheduler
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/scheduleringester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=scheduleringester
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=armada-server
Expand Down
2 changes: 1 addition & 1 deletion build_goreleaser/testsuite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE=alpine:3.18.3
ARG BASE_IMAGE=alpine:3.20.1
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=testsuite
LABEL org.opencontainers.image.description="Test Suite"
Expand Down
2 changes: 1 addition & 1 deletion cmd/armada-load-tester/cmd/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var loadtestCmd = &cobra.Command{
containers:
- name: sleep
imagePullPolicy: IfNotPresent
image: alpine:3.18.3
image: alpine:3.20.1
command:
- sh
args:
Expand Down
1 change: 1 addition & 0 deletions config/scheduler/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ scheduling:
disableScheduling: false
enableAssertions: false
protectedFractionOfFairShare: 1.0
useAdjustedFairShareProtection: true
nodeIdLabel: "kubernetes.io/hostname"
priorityClasses:
armada-default:
Expand Down
4 changes: 2 additions & 2 deletions developer/config/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
containers:
- name: sleep
imagePullPolicy: IfNotPresent
image: alpine:3.10
image: alpine:latest
args:
- "exit"
- "1"
Expand All @@ -26,4 +26,4 @@ jobs:
timeout: "100s"
expectedEvents:
- submitted:
- failed:
- failed:
2 changes: 1 addition & 1 deletion e2e/armadactl_test/armadactl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
containers:
- name: ls
imagePullPolicy: IfNotPresent
image: alpine:3.18.3
image: alpine:3.20.1
command:
- sh
- -c
Expand Down
3 changes: 3 additions & 0 deletions internal/armada/configuration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ type SubmissionConfig struct {
// will have activeDeadlineSeconds set to 1.
// Trumps DefaultActiveDeadline.
DefaultActiveDeadlineByResourceRequest map[string]time.Duration
// Maximum ratio of limits:requests per resource. Jobs who have a higher limits:resource ratio than this will be rejected.
// Any resource type missing from this map will default to 1.0.
MaxOversubscriptionByResourceRequest map[string]float64
}

// TODO: we can probably just typedef this to map[string]string
Expand Down
1 change: 1 addition & 0 deletions internal/armada/queryapi/query_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var JobStateMap = map[int16]api.JobState{
lookout.JobFailedOrdinal: api.JobState_FAILED,
lookout.JobCancelledOrdinal: api.JobState_CANCELLED,
lookout.JobPreemptedOrdinal: api.JobState_PREEMPTED,
lookout.JobRejectedOrdinal: api.JobState_REJECTED,
}

// JobRunStateMap is a mapping between database state and api Job Run states
Expand Down
40 changes: 23 additions & 17 deletions internal/armada/submit/validation/submit_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package validation
import (
"fmt"

v1 "k8s.io/api/core/v1"

"github.com/pkg/errors"
"k8s.io/component-helpers/scheduling/corev1/nodeaffinity"

Expand Down Expand Up @@ -210,28 +208,36 @@ func validatePriorityClasses(j *api.JobSubmitRequestItem, config configuration.S
// Ensures that the JobSubmitRequestItem's limits and requests are equal.
// Also checks that any resources defined are above minimum values set in config
func validateResources(j *api.JobSubmitRequestItem, config configuration.SubmissionConfig) error {
// Function which tells us if two k8s resource lists contain exactly the same elements
resourceListEquals := func(a v1.ResourceList, b v1.ResourceList) bool {
if len(a) != len(b) {
return false
}
for k, v := range a {
if v != b[k] {
return false
}
}
return true
}

spec := j.GetMainPodSpec()
maxOversubscriptionByResource := config.MaxOversubscriptionByResourceRequest
if maxOversubscriptionByResource == nil {
maxOversubscriptionByResource = map[string]float64{}
}
for _, container := range spec.Containers {

if len(container.Resources.Requests) == 0 && len(container.Resources.Requests) == 0 {
return fmt.Errorf("container %v has no resources specified", container.Name)
}

if !resourceListEquals(container.Resources.Requests, container.Resources.Limits) {
return fmt.Errorf("container %v does not have resource request and limit equal (this is currently not supported)", container.Name)
if len(container.Resources.Requests) != len(container.Resources.Limits) {
return fmt.Errorf("container %v defines different resources for requests and limits", container.Name)
}

for resource, request := range container.Resources.Requests {
limit, ok := container.Resources.Limits[resource]
if !ok {
return fmt.Errorf("container %v defines %s for requests but not limits", container.Name, resource)
}
if limit.MilliValue() < request.MilliValue() {
return fmt.Errorf("container %v defines %s with limits smaller than requests", container.Name, resource)
}
maxOversubscription, ok := maxOversubscriptionByResource[resource.String()]
if !ok {
maxOversubscription = 1.0
}
if float64(limit.MilliValue()) > maxOversubscription*float64(request.MilliValue()) {
return fmt.Errorf("container %v defines %s with limits great than %.2f*requests", container.Name, resource, maxOversubscription)
}
}

for rc, containerRsc := range container.Resources.Requests {
Expand Down
Loading

0 comments on commit 44f7703

Please sign in to comment.