Skip to content

Commit

Permalink
Werf prepare for CSE - initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Yakubov authored and Alexey Yakubov committed Jan 10, 2025
1 parent b58fd1b commit f9aecb4
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 53 deletions.
1 change: 0 additions & 1 deletion images/sds-local-volume-controller/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ require (
)

replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16

replace github.com/deckhouse/sds-local-volume/api => ../../../api
32 changes: 18 additions & 14 deletions images/sds-local-volume-controller/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
---
image: {{ $.ImageName }}-src-artifact
from: {{ $.BASE_ALT }}
from: {{ $.Root.BASE_ALT }}
final: false

git:
- add: /images/{{ $.ImageName }}
to: /
- add: /images/{{ $.ImageName }}/src
to: /src/images/{{ $.ImageName }}/src
stageDependencies:
install:
- "**/*"
- add: /api
to: /src/api
stageDependencies:
install:
- "**/*"
includePaths:
- patches

shell:
install:
- echo "src artifact"

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
Expand All @@ -23,9 +27,9 @@ final: false
git:
- add: /
to: /
includePaths:
- api
- images/sds-local-volume-controller/src
# includePaths:
# - api
# - src
stageDependencies:
setup:
- "**/*"
Expand All @@ -35,19 +39,19 @@ mount:
to: /go/pkg
shell:
setup:
- cd /images/sds-local-volume-controller/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /sds-local-volume-controller
- chmod +x /sds-local-volume-controller
- cd /src/images/{{ $.ImageName }}/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /{{ $.ImageName }}
- chmod +x /{{ $.ImageName }}

---
image: {{ $.ImageName }}
from: {{ $.Root.BASE_SCRATCH }}

import:
- image: {{ $.ImageName }}-golang-artifact
add: /sds-local-volume-controller
to: /sds-local-volume-controller
add: /{{ $.ImageName }}
to: /{{ $.ImageName }}
before: setup

docker:
ENTRYPOINT: ["/sds-local-volume-controller"]
ENTRYPOINT: ["/{{ $.ImageName }}"]
46 changes: 32 additions & 14 deletions images/sds-local-volume-csi/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
# Required for external analytics. Do not remove!
---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
final: false

git:
- add: /
to: /
includePaths:
- api
- images/sds-local-volume-csi/src
- add: /images/{{ $.ImageName }}/src
to: /src/images/{{ $.ImageName }}/src
stageDependencies:
install:
- "**/*"
- add: /api
to: /src/api
stageDependencies:
setup:
install:
- "**/*"

shell:
install:
- echo "src artifact"

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
final: false

import:
- image: {{ $.ImageName }}-src-artifact
add: /
to: /
before: setup

mount:
- fromPath: ~/go-pkg-cache
to: /go/pkg
shell:
setup:
- cd /images/sds-local-volume-csi/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /sds-local-volume-csi
- chmod +x /sds-local-volume-csi
- cd /src/images/{{ $.ImageName }}/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /{{ $.ImageName }}
- chmod +x /{{ $.ImageName }}

---
image: {{ $.ImageName }}
from: {{ $.Root.BASE_ALT_P11 }}

import:
- image: {{ $.ImageName }}-golang-artifact
add: /sds-local-volume-csi
to: /sds-local-volume-csi
add: /{{ $.ImageName }}
to: /{{ $.ImageName }}
before: setup

shell:
Expand All @@ -42,4 +60,4 @@ shell:
&& rm -rf /var/lib/apt/lists/*
docker:
ENTRYPOINT: ["/sds-local-volume-csi"]
ENTRYPOINT: ["/{{ $.ImageName }}"] #["/sds-local-volume-csi"]
1 change: 1 addition & 0 deletions images/sds-local-volume-scheduler-extender/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ require (
)

replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
replace github.com/deckhouse/sds-local-volume/api => ../../../api
46 changes: 34 additions & 12 deletions images/sds-local-volume-scheduler-extender/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
{{- $csiBinaries := "/usr/bin/curl" }}
# Required for external analytics. Do not remove!
---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
final: false

git:
- add: /images/sds-local-volume-scheduler-extender/src
to: /src
- add: /images/{{ $.ImageName }}/src
to: /src/images/{{ $.ImageName }}/src
stageDependencies:
setup:
install:
- "**/*"
- add: /api
to: /src/api
stageDependencies:
install:
- "**/*"

shell:
install:
- echo "src artifact"

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
final: false

import:
- image: {{ $.ImageName }}-src-artifact
add: /
to: /
before: setup

mount:
- fromPath: ~/go-pkg-cache
to: /go/pkg
shell:
setup:
- cd /src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o sds-local-volume-scheduler-extender
- mv sds-local-volume-scheduler-extender /sds-local-volume-scheduler-extender
- chmod +x /sds-local-volume-scheduler-extender
- cd /src/images/{{ $.ImageName }}/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /{{ $.ImageName }}
# - mv sds-local-volume-scheduler-extender /sds-local-volume-scheduler-extender
- chmod +x /{{ $.ImageName }}

---
image: {{ $.ImageName }}-binaries-artifact
Expand Down Expand Up @@ -66,8 +88,8 @@ fromImage: {{ $.ImageName }}-distroless

import:
- image: {{ $.ImageName }}-golang-artifact
add: /sds-local-volume-scheduler-extender
to: /sds-local-volume-scheduler-extender
add: /{{ $.ImageName }}
to: /{{ $.ImageName }}
before: setup
- image: {{ $.ImageName }}-binaries-artifact
add: /relocate
Expand All @@ -76,4 +98,4 @@ import:
includePaths:
- '**/*'
docker:
ENTRYPOINT: ["/sds-local-volume-scheduler-extender"]
ENTRYPOINT: ["/{{ $.ImageName }}"]
46 changes: 34 additions & 12 deletions images/webhooks/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
# Required for external analytics. Do not remove!
---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
final: false

git:
- add: /images/webhooks/src
to: /src
- add: /images/{{ $.ImageName }}/src
to: /src/images/{{ $.ImageName }}/src
stageDependencies:
install:
- "**/*"
- add: /api
to: /src/api
stageDependencies:
setup:
install:
- "**/*"

shell:
install:
- echo "src artifact"

---
image: {{ $.ImageName }}-golang-artifact
from: {{ $.Root.BASE_GOLANG_1_23 }}
final: false

import:
- image: {{ $.ImageName }}-src-artifact
add: /
to: /
before: setup

mount:
- fromPath: ~/go-pkg-cache
to: /go/pkg
shell:
setup:
- cd /src
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o webhooks
- mv webhooks /webhooks
- chmod +x /webhooks
- cd /src/images/{{ $.ImageName }}/src
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /{{ $.ImageName }}
# - mv webhooks /webhooks
- chmod +x /{{ $.ImageName }}
---
image: {{ $.ImageName }}
from: {{ $.Root.BASE_SCRATCH }}

import:
- image: {{ $.ImageName }}-golang-artifact
add: /webhooks
to: /webhooks
add: /{{ $.ImageName }}
to: /{{ $.ImageName }}
before: setup

docker:
ENTRYPOINT: ["/webhooks"]
ENTRYPOINT: ["/{{ $.ImageName }}"]

0 comments on commit f9aecb4

Please sign in to comment.