Skip to content

Commit

Permalink
Merge pull request #148 from equinor/main
Browse files Browse the repository at this point in the history
Release radix-job-scheduler
  • Loading branch information
nilsgstrabo authored Dec 17, 2024
2 parents 16b5ef5 + f187d4a commit d5f693a
Show file tree
Hide file tree
Showing 18 changed files with 889 additions and 448 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"RADIXOPERATOR_CLUSTER_TYPE": "development",
"RADIX_DNS_ZONE":"dev.radix.equinor.com",
"RADIX_CONTAINER_REGISTRY":"radixdev.azurecr.io",
"RADIX_ENVIRONMENT":"dev",
"RADIX_ENVIRONMENT":"qa",
"RADIX_APP":"radix-job-demo",
"RADIX_JOB_SCHEDULERS_PER_ENVIRONMENT_HISTORY_LIMIT": "2",
"RADIX_DEPLOYMENT": "dev-f6dbi-w5quewh2",
"RADIX_DEPLOYMENT": "qa-p4nif-6x2jbzhz",
"RADIX_COMPONENT": "compute",
"RADIX_PORTS": "8081",
"RADIXOPERATOR_APP_ENV_LIMITS_DEFAULT_CPU": "50m",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22-alpine3.20 AS builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22-alpine3.21 AS builder
ARG TARGETARCH
ENV CGO_ENABLED=0 \
GOOS=linux \
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ endif
CONTAINER_REPO ?= radix$(ENVIRONMENT)
DOCKER_REGISTRY ?= $(CONTAINER_REPO).azurecr.io

DOCKER_BUILDX_BUILD_BASE_CMD := docker buildx build -t $(DOCKER_REGISTRY)/radix-job-scheduler:$(TAG) --platform linux/arm64,linux/amd64 -f Dockerfile

echo:
@echo "ENVIRONMENT : " $(ENVIRONMENT)
@echo "DNS_ZONE : " $(DNS_ZONE)
Expand All @@ -31,22 +33,16 @@ swagger: bootstrap

.PHONY: docker-build
docker-build:
docker build -t $(DOCKER_REGISTRY)/radix-job-scheduler:$(TAG) -f Dockerfile .
${DOCKER_BUILDX_BUILD_BASE_CMD} .

.PHONY: docker-push
docker-push:
az acr login --name $(CONTAINER_REPO)
docker push $(DOCKER_REGISTRY)/radix-job-scheduler:$(TAG)
${DOCKER_BUILDX_BUILD_BASE_CMD} --push .

.PHONY: deploy
deploy: docker-build docker-push

.PHONY: docker-push-main
docker-push-main:
docker build -t $(DOCKER_REGISTRY)/radix-job-scheduler:main-latest -f Dockerfile .
az acr login --name $(CONTAINER_REPO)
docker push $(DOCKER_REGISTRY)/radix-job-scheduler:main-latest

.PHONY: test
test:
go test -cover `go list ./...`
Expand Down
9 changes: 4 additions & 5 deletions api/v1/controllers/batches/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
models "github.com/equinor/radix-job-scheduler/models/common"
modelsV1 "github.com/equinor/radix-job-scheduler/models/v1"
"github.com/equinor/radix-operator/pkg/apis/kube"
"github.com/equinor/radix-operator/pkg/apis/radix/v1"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -244,17 +243,17 @@ func TestCreateBatch(t *testing.T) {
{
Payload: "a_payload",
RadixJobComponentConfig: models.RadixJobComponentConfig{
Resources: &v1.ResourceRequirements{
Requests: v1.ResourceList{
Resources: &models.Resources{
Requests: models.ResourceList{
"cpu": "20m",
"memory": "256M",
},
Limits: v1.ResourceList{
Limits: models.ResourceList{
"cpu": "10m",
"memory": "128M",
},
},
Node: &v1.RadixNode{
Node: &models.Node{
Gpu: "nvidia",
GpuCount: "6",
},
Expand Down
9 changes: 4 additions & 5 deletions api/v1/controllers/jobs/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/equinor/radix-job-scheduler/api/v1/jobs/mock"
models "github.com/equinor/radix-job-scheduler/models/common"
modelsV1 "github.com/equinor/radix-job-scheduler/models/v1"
"github.com/equinor/radix-operator/pkg/apis/radix/v1"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -235,17 +234,17 @@ func TestCreateJob(t *testing.T) {
jobScheduleDescription := models.JobScheduleDescription{
Payload: "a_payload",
RadixJobComponentConfig: models.RadixJobComponentConfig{
Resources: &v1.ResourceRequirements{
Requests: v1.ResourceList{
Resources: &models.Resources{
Requests: models.ResourceList{
"cpu": "20m",
"memory": "256M",
},
Limits: v1.ResourceList{
Limits: models.ResourceList{
"cpu": "10m",
"memory": "128M",
},
},
Node: &v1.RadixNode{
Node: &models.Node{
Gpu: "nvidia",
GpuCount: "6",
},
Expand Down
Loading

0 comments on commit d5f693a

Please sign in to comment.