Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[internal] Migrate to ALT P11 #118

Merged
merged 13 commits into from
Jan 30, 2025
5 changes: 4 additions & 1 deletion .github/workflows/build_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ env:
MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }}
SOURCE_REPO: "${{ secrets.SOURCE_REPO }}"



on:
pull_request:
#pull_request:
push:
branches:
- main
# make this job as dependency for trivy_image_check workflow
# https://stackoverflow.com/a/71489231
workflow_call:


jobs:
dev_setup_build:
runs-on: [self-hosted, regular, selectel]
Expand Down
2 changes: 1 addition & 1 deletion images/agent/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module agent
go 1.22.2

require (
github.com/deckhouse/sds-node-configurator/api v0.0.0-20241205120718-db6ffba1689b
github.com/deckhouse/sds-node-configurator/api v0.0.0-20250114161813-c1a8b09cd47d
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.6.0
github.com/gosimple/slug v1.14.0
Expand Down
15 changes: 9 additions & 6 deletions images/agent/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic" }}
{{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2" }}
{{ $UTIL_LINUX_VERSION := "2.39.3" }}

# Do not remove. It's used in external tests.
---
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

git:
Expand All @@ -29,7 +29,7 @@ shell:

---
image: {{ $.ImageName }}-binaries-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

import:
Expand Down Expand Up @@ -63,7 +63,8 @@ shell:
automake \
gettext \
flex \
glibc-core
glibc-core \
cross-glibc-x86_64
- cd /src/util-linux
- ./autogen.sh
- ./configure LDFLAGS="-static" --enable-static-programs -disable-all-programs --enable-nsenter
Expand All @@ -75,7 +76,9 @@ shell:
- cp /lib64/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1
- cp /lib64/libc.so.6 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libc.so.6
- cp /lib64/libcap.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2
- cp /lib64/ld-2.32.so /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
# There is no more such file in P11 with glibc-core that it was a part of. Now it's /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2
#- cp /lib64/ld-2.32.so /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
- cp /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
- cp /opt/deckhouse/sds/bin/lsblk /opt/deckhouse/sds/bin/lsblk.dynamic
- chmod +x /binary_replace.sh
- /binary_replace.sh -i "{{ $binaries }}" -o /relocate
Expand Down Expand Up @@ -103,7 +106,7 @@ shell:

---
image: {{ $.ImageName }}-distroless-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

shell:
Expand Down
2 changes: 1 addition & 1 deletion images/sds-health-watcher-controller/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.3

require (
github.com/cloudflare/cfssl v1.5.0
github.com/deckhouse/sds-node-configurator/api v0.0.0-20241205120718-db6ffba1689b
github.com/deckhouse/sds-node-configurator/api v0.0.0-20250114161813-c1a8b09cd47d
github.com/go-logr/logr v1.4.2
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ import (
)

func KubernetesDefaultConfigCreate() (*rest.Config, error) {
// err is either nil and we return config or its value doesn't matter for us here
config, err := rest.InClusterConfig()
if err == nil {
return config, nil
}

clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
clientcmd.NewDefaultClientConfigLoadingRules(),
&clientcmd.ConfigOverrides{},
)

// Get a config to talk to API server
config, err := clientConfig.ClientConfig()
config, err = clientConfig.ClientConfig()

if err != nil {
return nil, fmt.Errorf("config kubernetes error %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions images/sds-health-watcher-controller/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Do not remove. It's used in external tests.
---
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

git:
Expand Down Expand Up @@ -46,7 +46,7 @@ shell:

---
image: {{ $.ImageName }}-distroless-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

shell:
Expand Down
6 changes: 3 additions & 3 deletions images/sds-utils-installer/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Do not remove. It's used in external tests.
---
image: {{ $.ImageName }}-src-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

git:
Expand All @@ -30,7 +30,7 @@ shell:

---
image: {{ $.ImageName }}-binaries-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

import:
Expand Down Expand Up @@ -94,7 +94,7 @@ shell:

---
image: {{ $.ImageName }}-distroless-artifact
from: {{ $.Root.BASE_ALT }}
from: {{ $.Root.BASE_ALT_P11 }}
final: false

shell:
Expand Down
Loading