Skip to content

Commit

Permalink
Add scheduler to go-releaser and github action to publish images
Browse files Browse the repository at this point in the history
  • Loading branch information
suprjinx committed Apr 13, 2023
1 parent c9456e7 commit 9a55deb
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-release-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
docker save armada-lookout-v2 | gzip > docker-images/armada-lookout-v2.tar.gz
docker save armada-lookout-ingester-v2 | gzip > docker-images/armada-lookout-ingester-v2.tar.gz
docker save armada-event-ingester | gzip > docker-images/armada-event-ingester.tar.gz
docker save armada-scheduler | gzip > docker-images/armada-scheduler.tar.gz
docker save armada-scheduler-ingester | gzip > docker-images/armada-scheduler-ingester.tar.gz
docker save armada-binoculars | gzip > docker-images/armada-binoculars.tar.gz
docker save armada-jobservice | gzip > docker-images/armada-jobservice.tar.gz
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upload-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
uploads['armada']='armada-server'
uploads['armada-binoculars']='armada-binoculars'
uploads['armada-event-ingester']='armada-event-ingester'
uploads['armada-scheduler']='armada-scheduler'
uploads['armada-scheduler-ingester']='armada-scheduler-ingester'
uploads['armada-executor']='armada-executor'
uploads['armada-jobservice']='armada-jobservice'
uploads['armada-lookout']='armada-lookout'
Expand Down
86 changes: 70 additions & 16 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ builds:
- linux
goarch:
- amd64
- env: [CGO_ENABLED=0]
id: scheduler
binary: scheduler
main: ./cmd/scheduler/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
goarch:
- amd64
- env: [CGO_ENABLED=0]
id: scheduleringester
binary: scheduleringester
main: ./cmd/scheduleringester/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
goarch:
- amd64
- env: [CGO_ENABLED=0]
id: jobservice
binary: jobservice
Expand Down Expand Up @@ -142,20 +160,6 @@ env:
- DOCKER_BUILDX_CACHE_FROM={{ if index .Env "DOCKER_BUILDX_CACHE_FROM" }}{{ .Env.DOCKER_BUILDX_CACHE_FROM }}{{ else }}type=registry{{ end }}
- DOCKER_BUILDX_CACHE_TO={{ if index .Env "DOCKER_BUILDX_CACHE_TO" }}{{ .Env.DOCKER_BUILDX_CACHE_TO }}{{ else }}type=inline{{ end }}

build_flag_templates: &BUILD_FLAG_TEMPLATES
- --build-arg={{ .Env.BASE_IMAGE_ARG }}
- --builder={{ .Env.DOCKER_BUILDX_BUILDER }}
- --cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}
- --cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}
- --label=org.opencontainers.image.source=https://github.com/armadaproject/armada
- --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.17.0
- --label=org.opencontainers.image.base.digest=c0d488a800e4
- --label=org.opencontainers.image.licenses=Apache-2.0
- --label=org.opencontainers.image.vendor=G-Research

dockers:
- id: bundle
use: buildx
Expand All @@ -164,17 +168,33 @@ dockers:
image_templates:
- "{{ .Env.DOCKER_REPO }}armada:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "{{ .Env.DOCKER_REPO }}armada:latest"
build_flag_templates: *BUILD_FLAG_TEMPLATES
build_flag_templates: &BUILD_FLAG_TEMPLATES
- --build-arg={{ .Env.BASE_IMAGE_ARG }}
- --builder={{ .Env.DOCKER_BUILDX_BUILDER }}
- --cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}
- --cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}
- --label=org.opencontainers.image.source=https://github.com/armadaproject/armada
- --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.17.0
- --label=org.opencontainers.image.base.digest=c0d488a800e4
- --label=org.opencontainers.image.licenses=Apache-2.0
- --label=org.opencontainers.image.vendor=G-Research
ids:
- server
- executor
- binoculars
- eventingester
- scheduler
- scheduleringester
extra_files:
- config/armada/config.yaml
- config/executor/config.yaml
- config/binoculars/config.yaml
- config/eventingester/config.yaml
- config/scheduler/config.yaml
- config/scheduleringester/config.yaml
dockerfile: ./build_goreleaser/bundles/armada/Dockerfile

- id: lookout-bundle
Expand Down Expand Up @@ -302,7 +322,7 @@ dockers:
- lookout
- lookoutingester
extra_files:
- internal\lookout\ui
- internal/lookout/ui
- pkg/api/api.swagger.json
- pkg/api/lookout/api.swagger.json
- pkg/api/binoculars/api.swagger.json
Expand Down Expand Up @@ -340,6 +360,34 @@ dockers:
- config/eventingester/config.yaml
dockerfile: ./build_goreleaser/eventingester/Dockerfile

- id: scheduler
use: buildx
goos: linux
goarch: amd64
image_templates:
- "{{ .Env.DOCKER_REPO }}armada-scheduler:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "{{ .Env.DOCKER_REPO }}armada-scheduler:latest"
build_flag_templates: *BUILD_FLAG_TEMPLATES
ids:
- scheduler
extra_files:
- config/scheduler/config.yaml
dockerfile: ./build_goreleaser/scheduler/Dockerfile

- id: scheduleringester
use: buildx
goos: linux
goarch: amd64
image_templates:
- "{{ .Env.DOCKER_REPO }}armada-scheduleringester:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
- "{{ .Env.DOCKER_REPO }}armada-scheduleringester:latest"
build_flag_templates: *BUILD_FLAG_TEMPLATES
ids:
- scheduleringester
extra_files:
- config/scheduleringester/config.yaml
dockerfile: ./build_goreleaser/scheduleringester/Dockerfile

- id: binoculars
use: buildx
goos: linux
Expand Down Expand Up @@ -407,6 +455,12 @@ release:
### Armada Event Ingester
- `docker pull {{ .Env.DOCKER_REPO }}armada-eventingester:{{ .Major }}.{{ .Minor }}.{{ .Patch }}`
- `docker pull {{ .Env.DOCKER_REPO }}armada-eventingester:latest`
### Armada Scheduler
- `docker pull {{ .Env.DOCKER_REPO }}armada-scheduler:{{ .Major }}.{{ .Minor }}.{{ .Patch }}`
- `docker pull {{ .Env.DOCKER_REPO }}armada-scheduler:latest`
### Armada Scheduler Ingester
- `docker pull {{ .Env.DOCKER_REPO }}armada-scheduleringester:{{ .Major }}.{{ .Minor }}.{{ .Patch }}`
- `docker pull {{ .Env.DOCKER_REPO }}armada-scheduleringester:latest`
### Armada Binoculars
- `docker pull {{ .Env.DOCKER_REPO }}armada-binoculars:{{ .Major }}.{{ .Minor }}.{{ .Patch }}`
- `docker pull {{ .Env.DOCKER_REPO }}armada-binoculars:latest`
Expand Down
13 changes: 13 additions & 0 deletions build_goreleaser/scheduler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG BASE_IMAGE=alpine:3.17.0

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=scheduler
LABEL org.opencontainers.image.description="Scheduler"
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearchdev/scheduler

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada
USER armada
COPY scheduler /app/
COPY config/scheduler/config.yaml /app/config/scheduler/config.yaml
WORKDIR /app
ENTRYPOINT ["./scheduler"]
13 changes: 13 additions & 0 deletions build_goreleaser/scheduleringester/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ARG BASE_IMAGE=alpine:3.17.0

FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.title=scheduleringester
LABEL org.opencontainers.image.description="Scheduler Ingester"
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearchdev/scheduleringester

RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada
USER armada
COPY scheduleringester /app/
COPY config/scheduleringester/config.yaml /app/config/scheduleringester/config.yaml
WORKDIR /app
ENTRYPOINT ["./scheduleringester"]

0 comments on commit 9a55deb

Please sign in to comment.