Skip to content

Commit

Permalink
chore: use common infra provider library
Browse files Browse the repository at this point in the history
Switch to using the common infra provider library.

Signed-off-by: Artem Chernyshev <[email protected]>
  • Loading branch information
Unix4ever committed Sep 5, 2024
1 parent 602810d commit a22b088
Show file tree
Hide file tree
Showing 28 changed files with 1,068 additions and 1,009 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-07-31T12:19:21Z by kres faf91e3.
# Generated on 2024-09-02T11:17:15Z by kres b5ca957.

name: default
concurrency:
Expand Down Expand Up @@ -104,37 +104,37 @@ jobs:
PUSH: "true"
run: |
make image-talemu IMAGE_TAG=latest
- name: talemu-cloud-provider
- name: talemu-infra-provider
run: |
make talemu-cloud-provider
make talemu-infra-provider
- name: Login to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
- name: image-talemu-cloud-provider
- name: image-talemu-infra-provider
run: |
make image-talemu-cloud-provider
- name: push-talemu-cloud-provider
make image-talemu-infra-provider
- name: push-talemu-infra-provider
if: github.event_name != 'pull_request'
env:
PUSH: "true"
run: |
make image-talemu-cloud-provider
- name: push-talemu-cloud-provider-latest
make image-talemu-infra-provider
- name: push-talemu-infra-provider-latest
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
env:
PUSH: "true"
run: |
make image-talemu-cloud-provider IMAGE_TAG=latest
make image-talemu-infra-provider IMAGE_TAG=latest
- name: Generate Checksums
if: startsWith(github.ref, 'refs/tags/')
run: |
cd _out
sha256sum talemu-* talemu-cloud-provider-* > sha256sum.txt
sha512sum talemu-* talemu-cloud-provider-* > sha512sum.txt
sha256sum talemu-* talemu-infra-provider-* > sha256sum.txt
sha512sum talemu-* talemu-infra-provider-* > sha512sum.txt
- name: release-notes
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand All @@ -147,5 +147,5 @@ jobs:
draft: "true"
files: |-
_out/talemu-*
_out/talemu-cloud-provider-*
_out/talemu-infra-provider-*
_out/sha*.txt
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-08-14T14:55:16Z by kres 7be2a05.
# Generated on 2024-09-02T11:17:15Z by kres b5ca957.

ARG TOOLCHAIN

Expand All @@ -11,7 +11,7 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.7.0 AS image-ca-certificates
FROM ghcr.io/siderolabs/fhs:v1.7.0 AS image-fhs

# runs markdownlint
FROM docker.io/oven/bun:1.1.22-alpine AS lint-markdown
FROM docker.io/oven/bun:1.1.26-alpine AS lint-markdown
WORKDIR /src
RUN bun i [email protected] [email protected]
COPY .markdownlint.json .
Expand Down Expand Up @@ -120,13 +120,13 @@ COPY --from=proto-compile /api/ /api/
FROM scratch AS unit-tests
COPY --from=unit-tests-run /src/coverage.txt /coverage-unit-tests.txt

# builds talemu-cloud-provider-linux-amd64
FROM base AS talemu-cloud-provider-linux-amd64-build
# builds talemu-infra-provider-linux-amd64
FROM base AS talemu-infra-provider-linux-amd64-build
COPY --from=generate / /
WORKDIR /src/cmd/talemu-cloud-provider
WORKDIR /src/cmd/talemu-infra-provider
ARG GO_BUILDFLAGS
ARG GO_LDFLAGS
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talemu-cloud-provider-linux-amd64
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talemu-infra-provider-linux-amd64

# builds talemu-linux-amd64
FROM base AS talemu-linux-amd64-build
Expand All @@ -136,29 +136,29 @@ ARG GO_BUILDFLAGS
ARG GO_LDFLAGS
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go build ${GO_BUILDFLAGS} -ldflags "${GO_LDFLAGS}" -o /talemu-linux-amd64

FROM scratch AS talemu-cloud-provider-linux-amd64
COPY --from=talemu-cloud-provider-linux-amd64-build /talemu-cloud-provider-linux-amd64 /talemu-cloud-provider-linux-amd64
FROM scratch AS talemu-infra-provider-linux-amd64
COPY --from=talemu-infra-provider-linux-amd64-build /talemu-infra-provider-linux-amd64 /talemu-infra-provider-linux-amd64

FROM scratch AS talemu-linux-amd64
COPY --from=talemu-linux-amd64-build /talemu-linux-amd64 /talemu-linux-amd64

FROM talemu-cloud-provider-linux-${TARGETARCH} AS talemu-cloud-provider
FROM talemu-infra-provider-linux-${TARGETARCH} AS talemu-infra-provider

FROM scratch AS talemu-cloud-provider-all
COPY --from=talemu-cloud-provider-linux-amd64 / /
FROM scratch AS talemu-infra-provider-all
COPY --from=talemu-infra-provider-linux-amd64 / /

FROM talemu-linux-${TARGETARCH} AS talemu

FROM scratch AS talemu-all
COPY --from=talemu-linux-amd64 / /

FROM scratch AS image-talemu-cloud-provider
FROM scratch AS image-talemu-infra-provider
ARG TARGETARCH
COPY --from=talemu-cloud-provider talemu-cloud-provider-linux-${TARGETARCH} /talemu-cloud-provider
COPY --from=talemu-infra-provider talemu-infra-provider-linux-${TARGETARCH} /talemu-infra-provider
COPY --from=image-fhs / /
COPY --from=image-ca-certificates / /
LABEL org.opencontainers.image.source=https://github.com/siderolabs/talemu
ENTRYPOINT ["/talemu-cloud-provider"]
ENTRYPOINT ["/talemu-infra-provider"]

FROM scratch AS image-talemu
ARG TARGETARCH
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-08-14T14:58:43Z by kres 7be2a05.
# Generated on 2024-09-02T11:17:15Z by kres b5ca957.

# common variables

Expand All @@ -19,12 +19,12 @@ USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.34.2
GRPC_GO_VERSION ?= 1.5.1
GRPC_GATEWAY_VERSION ?= 2.21.0
GRPC_GATEWAY_VERSION ?= 2.22.0
VTPROTOBUF_VERSION ?= 0.6.0
GOIMPORTS_VERSION ?= 0.24.0
DEEPCOPY_VERSION ?= v0.5.6
GOLANGCILINT_VERSION ?= v1.60.1
GOFUMPT_VERSION ?= v0.6.0
GOLANGCILINT_VERSION ?= v1.60.3
GOFUMPT_VERSION ?= v0.7.0
GO_VERSION ?= 1.23.0
GO_BUILDFLAGS ?=
GO_LDFLAGS ?=
Expand Down Expand Up @@ -135,7 +135,7 @@ else
GO_LDFLAGS += -s
endif

all: unit-tests talemu image-talemu talemu-cloud-provider image-talemu-cloud-provider docker-compose-up docker-compose-down docker-compose-provider-up docker-compose-provider-down lint
all: unit-tests talemu image-talemu talemu-infra-provider image-talemu-infra-provider docker-compose-up docker-compose-down docker-compose-provider-up docker-compose-provider-down lint

$(ARTIFACTS): ## Creates artifacts directory.
@mkdir -p $(ARTIFACTS)
Expand Down Expand Up @@ -203,19 +203,19 @@ lint: lint-golangci-lint lint-gofumpt lint-govulncheck lint-markdown ## Run all
image-talemu: ## Builds image for talemu.
@$(MAKE) target-$@ TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/talemu:$(IMAGE_TAG)"

.PHONY: $(ARTIFACTS)/talemu-cloud-provider-linux-amd64
$(ARTIFACTS)/talemu-cloud-provider-linux-amd64:
@$(MAKE) local-talemu-cloud-provider-linux-amd64 DEST=$(ARTIFACTS)
.PHONY: $(ARTIFACTS)/talemu-infra-provider-linux-amd64
$(ARTIFACTS)/talemu-infra-provider-linux-amd64:
@$(MAKE) local-talemu-infra-provider-linux-amd64 DEST=$(ARTIFACTS)

.PHONY: talemu-cloud-provider-linux-amd64
talemu-cloud-provider-linux-amd64: $(ARTIFACTS)/talemu-cloud-provider-linux-amd64 ## Builds executable for talemu-cloud-provider-linux-amd64.
.PHONY: talemu-infra-provider-linux-amd64
talemu-infra-provider-linux-amd64: $(ARTIFACTS)/talemu-infra-provider-linux-amd64 ## Builds executable for talemu-infra-provider-linux-amd64.

.PHONY: talemu-cloud-provider
talemu-cloud-provider: talemu-cloud-provider-linux-amd64 ## Builds executables for talemu-cloud-provider.
.PHONY: talemu-infra-provider
talemu-infra-provider: talemu-infra-provider-linux-amd64 ## Builds executables for talemu-infra-provider.

.PHONY: image-talemu-cloud-provider
image-talemu-cloud-provider: ## Builds image for talemu-cloud-provider.
@$(MAKE) target-$@ TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/talemu-cloud-provider:$(IMAGE_TAG)"
.PHONY: image-talemu-infra-provider
image-talemu-infra-provider: ## Builds image for talemu-infra-provider.
@$(MAKE) target-$@ TARGET_ARGS="--tag=$(REGISTRY)/$(USERNAME)/talemu-infra-provider:$(IMAGE_TAG)"

.PHONY: docker-compose-up
docker-compose-up:
Expand Down
Loading

0 comments on commit a22b088

Please sign in to comment.