From 91c2b7c80d6dcdbea6cc1b4a11c6dbdf778f464c Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Tue, 18 Apr 2023 13:39:21 +0000 Subject: [PATCH] Generated commit to update templated files based on rev 0a2908a in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: razvan with message [Post release 23.4] --- .github/workflows/build.yml | 40 +++++++++++++------------- .gitignore | 7 +---- .readme/partials/borrowed/footer.md.j2 | 2 +- Makefile | 6 ++-- README.md | 2 +- Tiltfile | 2 ++ default.nix | 30 ++++++++++++++----- deploy/stackable-operators-ns.yaml | 5 ++++ docker/Dockerfile | 7 +++-- rust-toolchain.toml | 2 +- tests/ansible/playbook.yaml | 6 ---- tests/ansible/requirements.yaml | 4 --- 12 files changed, 63 insertions(+), 50 deletions(-) create mode 100644 deploy/stackable-operators-ns.yaml delete mode 100644 tests/ansible/playbook.yaml delete mode 100644 tests/ansible/requirements.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f6b88f4..1487fa33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,19 +31,19 @@ jobs: env: RUSTC_BOOTSTRAP: 1 steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 with: key: udeps - run: cargo install cargo-udeps - - run: cargo udeps + - run: cargo udeps --workspace # This job evaluates the github environment to determine why this action is running and selects the appropriate # target repository for published Helm charts based on this. @@ -116,7 +116,7 @@ jobs: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 with: components: rustfmt - run: cargo fmt --all -- --check @@ -125,14 +125,14 @@ jobs: name: Run Clippy runs-on: ubuntu-latest steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 with: components: clippy - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 @@ -156,14 +156,14 @@ jobs: name: Run RustDoc runs-on: ubuntu-latest steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 with: components: rustfmt - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 @@ -175,14 +175,14 @@ jobs: name: Run Cargo Tests runs-on: ubuntu-latest steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 with: key: test @@ -230,10 +230,10 @@ jobs: name: Check if committed Helm charts are up to date runs-on: ubuntu-latest steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - name: Checkout uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: @@ -243,7 +243,7 @@ jobs: with: version: v3.6.2 - name: Set up cargo - uses: dtolnay/rust-toolchain@1.65.0 + uses: dtolnay/rust-toolchain@1.68.2 - name: Set up rust-cache uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 with: @@ -288,17 +288,17 @@ jobs: outputs: IMAGE_TAG: ${{ steps.printtag.outputs.IMAGE_TAG }} steps: - - name: Install protoc + - name: Install host dependencies run: | sudo apt-get update - sudo apt-get install protobuf-compiler + sudo apt-get install protobuf-compiler krb5-user libkrb5-dev - name: Checkout uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: submodules: recursive - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4 if: ${{ github.event_name == 'pull_request' }} - - uses: dtolnay/rust-toolchain@1.65.0 + - uses: dtolnay/rust-toolchain@1.68.2 with: components: rustfmt - name: Install requirements for version tool diff --git a/.gitignore b/.gitignore index 42d660d0..44b2140f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,9 +14,4 @@ crate-hashes.json result image.tar -tilt_options.json - -deploy/olm/*/bundle -deploy/olm/*/bundle.Dockerfile -deploy/olm/*/catalog.Dockerfile -deploy/olm/*/catalog +tilt_options.json \ No newline at end of file diff --git a/.readme/partials/borrowed/footer.md.j2 b/.readme/partials/borrowed/footer.md.j2 index cacf26a8..8c9aa897 100644 --- a/.readme/partials/borrowed/footer.md.j2 +++ b/.readme/partials/borrowed/footer.md.j2 @@ -21,7 +21,7 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes 1.21-1.25 +* Kubernetes 1.23-1.26 We are currently working to support: diff --git a/Makefile b/Makefile index a351ae93..1a9bb4fb 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,8 @@ chart-clean: rm -rf "deploy/helm/${OPERATOR_NAME}/crds" version: - yq eval -i ".version = \"${VERSION}\" | .appVersion = \"${VERSION}\"" /dev/stdin < "deploy/helm/${OPERATOR_NAME}/Chart.yaml" + cat "deploy/helm/${OPERATOR_NAME}/Chart.yaml" | yq ".version = \"${VERSION}\" | .appVersion = \"${VERSION}\"" > "deploy/helm/${OPERATOR_NAME}/Chart.yaml.new" + mv "deploy/helm/${OPERATOR_NAME}/Chart.yaml.new" "deploy/helm/${OPERATOR_NAME}/Chart.yaml" config: if [ -d "deploy/config-spec/" ]; then\ @@ -78,4 +79,5 @@ build: regenerate-charts helm-package docker-build publish: build docker-publish helm-publish run-dev: - nix run -f. tilt -- up --port 5434 \ No newline at end of file + kubectl apply -f deploy/stackable-operators-ns.yaml + nix run -f. tilt -- up --port 5434 --namespace stackable-operators diff --git a/README.md b/README.md index 92ed9ea9..da1bf976 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes 1.21-1.25 +* Kubernetes 1.23-1.26 We are currently working to support: diff --git a/Tiltfile b/Tiltfile index 375a77e9..4d9cc0e8 100644 --- a/Tiltfile +++ b/Tiltfile @@ -12,6 +12,7 @@ custom_build( registry + '/' + operator_name, 'nix shell -f . crate2nix -c crate2nix generate && nix-build . -A docker --argstr dockerName "${EXPECTED_REGISTRY}/' + operator_name + '" && ./result/load-image | docker load', deps=['rust', 'Cargo.toml', 'Cargo.lock', 'default.nix', "nix", 'build.rs', 'vendor'], + ignore=['*.~undo-tree~'], # ignore=['result*', 'Cargo.nix', 'target', *.yaml], outputs_image_ref_to='result/ref', ) @@ -26,6 +27,7 @@ helm_crds, helm_non_crds = filter_yaml( helm( 'deploy/helm/' + operator_name, name=operator_name, + namespace="stackable-operators", set=[ 'image.repository=' + registry + '/' + operator_name, ], diff --git a/default.nix b/default.nix index 1cf848c2..1133d27f 100644 --- a/default.nix +++ b/default.nix @@ -10,6 +10,15 @@ tonic-reflection = attrs: { buildInputs = [ pkgs.rustfmt ]; }; + stackable-secret-operator = attrs: { + buildInputs = [ pkgs.protobuf pkgs.rustfmt ]; + }; + krb5-sys = attrs: { + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ (pkgs.enableDebugging pkgs.krb5) ]; + LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; + BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include"; + }; }; } , meta ? pkgs.lib.importJSON ./nix/meta.json @@ -27,14 +36,21 @@ rec { dockerImage = pkgs.dockerTools.streamLayeredImage { name = dockerName; tag = dockerTag; - contents = [ pkgs.bashInteractive pkgs.coreutils pkgs.util-linuxMinimal ]; + contents = [ + # Common debugging tools + pkgs.bashInteractive pkgs.coreutils pkgs.util-linuxMinimal + # Kerberos 5 must be installed globally to load plugins correctly + pkgs.krb5 + # Make the whole cargo workspace available on $PATH + build + ]; config = { - Env = - let - fileRefVars = { - PRODUCT_CONFIG = deploy/config-spec/properties.yaml; - }; - in pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars); + Env = + let + fileRefVars = { + PRODUCT_CONFIG = deploy/config-spec/properties.yaml; + }; + in pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars); Entrypoint = [ entrypoint ]; Cmd = [ "run" ]; }; diff --git a/deploy/stackable-operators-ns.yaml b/deploy/stackable-operators-ns.yaml new file mode 100644 index 00000000..7e955849 --- /dev/null +++ b/deploy/stackable-operators-ns.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: stackable-operators diff --git a/docker/Dockerfile b/docker/Dockerfile index 11fa4e0e..d97391e4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -23,14 +23,17 @@ RUN microdnf install -y yum \ && yum clean all \ && microdnf clean all +# Install kerberos client libraries +RUN microdnf install -y krb5-libs libkadm5 && microdnf clean all + COPY LICENSE /licenses/LICENSE -COPY --from=builder /app/stackable-hdfs-operator / +COPY --from=builder /app/* /usr/local/bin/ COPY deploy/config-spec/properties.yaml /etc/stackable/hdfs-operator/config-spec/properties.yaml RUN groupadd -g 1000 stackable && adduser -u 1000 -g stackable -c 'Stackable Operator' stackable USER stackable:stackable -ENTRYPOINT ["/stackable-hdfs-operator"] +ENTRYPOINT ["stackable-hdfs-operator"] CMD ["run"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f8c2abbb..864d3c41 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.65.0" +channel = "1.68.2" diff --git a/tests/ansible/playbook.yaml b/tests/ansible/playbook.yaml deleted file mode 100644 index f580831f..00000000 --- a/tests/ansible/playbook.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Expand test templates into test scenarios by applying input dimensions - hosts: localhost - connection: local - roles: - - expand-tests diff --git a/tests/ansible/requirements.yaml b/tests/ansible/requirements.yaml deleted file mode 100644 index d7aef5c1..00000000 --- a/tests/ansible/requirements.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: expand-tests - src: https://github.com/stackabletech/expand-tests.git - scm: git