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

Include bootstrap.sh in main image #885

Merged
merged 5 commits into from Apr 1, 2024
Merged

Conversation

djjudas21
Copy link
Contributor

Include bootstrap.sh in main image to allow Kubernetes to run a bootstrap job from the same image

Fixes #884

@djjudas21
Copy link
Contributor Author

I attempted to build the image locally as a sanity check for this trivial change, but it failed to build. I have no idea about the rust ecosystem 🙃

[1/4] STEP 5/5: RUN set -x     && RUSTFLAGS=-Ctarget-feature=-crt-static cargo install wasm-pack cargo-chef     && rustup target add wasm32-unknown-unknown
+ RUSTFLAGS='-Ctarget-feature=-crt-static' cargo install wasm-pack cargo-chef
    Updating crates.io index
 Downloading crates ...
  Downloaded wasm-pack v0.12.1
 Downloading crates ...
  Downloaded cargo-chef v0.1.66
  Installing wasm-pack v0.12.1
 Downloading crates ...
  Downloaded addr2line v0.21.0
  Downloaded atty v0.2.14
  Downloaded cfg-if v1.0.0
  Downloaded anstyle v1.0.6
  Downloaded byteorder v1.5.0
  Downloaded colorchoice v1.0.0
  Downloaded constant_time_eq v0.1.5
  Downloaded equivalent v1.0.1
  Downloaded cpufeatures v0.2.12
  Downloaded anstyle-query v1.0.2
  Downloaded home v0.5.9
  Downloaded autocfg v1.2.0
  Downloaded cargo_metadata v0.15.4
  Downloaded cargo-platform v0.1.8
  Downloaded block-buffer v0.10.4
  Downloaded bzip2 v0.4.4
  Downloaded base64ct v1.6.0
  Downloaded num-conv v0.1.0
  Downloaded crypto-common v0.1.6
  Downloaded dirs-next v2.0.0
  Downloaded adler v1.0.2
  Downloaded dirs-sys-next v0.1.2
  Downloaded form_urlencoded v1.2.1
  Downloaded deranged v0.3.11
  Downloaded either v1.10.0
  Downloaded errno v0.3.8
  Downloaded time-core v0.1.2
  Downloaded inout v0.1.3
  Downloaded hex v0.4.3
  Downloaded generic-array v0.14.7
  Downloaded fastrand v2.0.2
  Downloaded itoa v1.0.11
  Downloaded lazy_static v1.4.0
  Downloaded glob v0.3.1
  Downloaded percent-encoding v2.3.1
  Downloaded heck v0.5.0
  Downloaded tinyvec_macros v0.1.1
  Downloaded camino v1.1.6
  Downloaded anstyle-parse v0.2.3
  Downloaded anstream v0.6.13
  Downloaded pbkdf2 v0.11.0
  Downloaded pkg-config v0.3.30
  Downloaded fs2 v0.4.3
  Downloaded powerfmt v0.2.0
  Downloaded cipher v0.4.4
  Downloaded same-file v1.0.6
  Downloaded toml_datetime v0.6.5
  Downloaded serde_ignored v0.1.10
  Downloaded rand_core v0.6.4
  Downloaded xattr v1.3.1
  Downloaded subtle v2.5.0
  Downloaded clap_lex v0.7.0
  Downloaded siphasher v0.3.11
  Downloaded clap_derive v4.5.4
  Downloaded digest v0.10.7
  Downloaded filetime v0.2.23
  Downloaded dialoguer v0.10.4
  Downloaded crc32fast v1.4.0
  Downloaded console v0.15.8
  Downloaded serde_spanned v0.6.5
  Downloaded iana-time-zone v0.1.60
  Downloaded bitflags v2.5.0
  Downloaded untrusted v0.9.0
  Downloaded utf8parse v0.2.1
  Downloaded lock_api v0.4.11
  Downloaded os_info v3.8.2
  Downloaded thiserror v1.0.58
  Downloaded zeroize v1.7.0
  Downloaded anyhow v1.0.81
  Downloaded parking_lot_core v0.9.9
  Downloaded strsim v0.11.0
  Downloaded scopeguard v1.2.0
  Downloaded rustls-pki-types v1.4.1
  Downloaded proc-macro2 v1.0.79
  Downloaded binary-install v0.2.0
  Downloaded thiserror-impl v1.0.58
  Downloaded semver v1.0.22
  Downloaded quote v1.0.35
  Downloaded env_logger v0.10.2
  Downloaded sha1 v0.10.6
  Downloaded getrandom v0.2.12
  Downloaded clap v4.5.4
  Downloaded jobserver v0.1.28
  Downloaded log v0.4.21
  Downloaded shell-words v1.1.0
  Downloaded password-hash v0.4.2
  Downloaded once_cell v1.19.0
  Downloaded unicode-width v0.1.11
  Downloaded hmac v0.12.1
  Downloaded version_check v0.9.4
  Downloaded strsim v0.10.0
  Downloaded parking_lot v0.12.1
  Downloaded cc v1.0.90
  Downloaded zstd-safe v5.0.2+zstd.1.5.2
  Downloaded which v4.4.2
  Downloaded rustc-demangle v0.1.23
  Downloaded is_executable v0.1.2
  Downloaded human-panic v1.2.3
  Downloaded num-traits v0.2.18
  Downloaded flate2 v1.0.28
  Downloaded spin v0.9.8
  Downloaded miniz_oxide v0.7.2
  Downloaded backtrace v0.3.71
  Downloaded walkdir v2.5.0
  Downloaded base64 v0.21.7
  Downloaded ryu v1.0.17
  Downloaded indexmap v2.2.6
  Downloaded tempfile v3.10.1
  Downloaded serde v1.0.197
  Downloaded zstd v0.11.2+zstd.1.5.2
  Downloaded sha2 v0.10.8
  Downloaded memchr v2.7.2
  Downloaded aes v0.8.4
  Downloaded toml v0.8.12
  Downloaded unicode-ident v1.0.12
  Downloaded tinyvec v1.6.0
  Downloaded uuid v1.8.0
  Downloaded hashbrown v0.14.3
  Downloaded typenum v1.17.0
  Downloaded smallvec v1.13.2
  Downloaded toml v0.7.8
  Downloaded serde_derive v1.0.197
  Downloaded unicode-bidi v0.3.15
  Downloaded clap_builder v4.5.2
  Downloaded zip v0.6.6
  Downloaded tar v0.4.40
  Downloaded url v2.5.0
  Downloaded rustls-webpki v0.102.2
  Downloaded toml_edit v0.22.9
  Downloaded chrono v0.4.37
  Downloaded idna v0.5.0
  Downloaded toml_edit v0.19.15
  Downloaded ureq v2.9.6
  Downloaded gimli v0.28.1
  Downloaded object v0.32.2
  Downloaded unicode-normalization v0.1.23
  Downloaded time v0.3.34
  Downloaded serde_json v1.0.115
  Downloaded webpki-roots v0.26.1
  Downloaded rustls v0.22.3
  Downloaded winnow v0.5.40
  Downloaded rustix v0.38.32
  Downloaded syn v2.0.55
  Downloaded bzip2-sys v0.1.11+1.0.8
  Downloaded libc v0.2.153
  Downloaded zstd-sys v2.0.10+zstd.1.5.6
  Downloaded linux-raw-sys v0.4.13
  Downloaded ring v0.17.8
  Installing cargo-chef v0.1.66
 Downloading crates ...
  Downloaded is-terminal v0.4.12
  Downloaded pathdiff v0.2.1
  Downloaded termcolor v1.4.1
  Downloaded bitflags v1.3.2
  Downloaded globwalk v0.8.1
  Downloaded humantime v2.1.0
  Downloaded fs-err v2.11.0
  Downloaded crossbeam-deque v0.8.5
  Downloaded expect-test v1.4.1
  Downloaded cargo-manifest v0.9.0
  Downloaded globset v0.4.14
  Downloaded dissimilar v1.0.7
  Downloaded crossbeam-epoch v0.9.18
  Downloaded ignore v0.4.22
  Downloaded crossbeam-utils v0.8.19
  Downloaded aho-corasick v1.1.3
  Downloaded regex v1.10.4
  Downloaded regex-syntax v0.8.3
  Downloaded bstr v1.9.1
  Downloaded regex-automata v0.4.6
error: failed to compile `wasm-pack v0.12.1`, intermediate artifacts can be found at `/tmp/cargo-installvBY7Dh`

Caused by:
  package `clap_derive v4.5.4` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.69.0
  Try re-running cargo install with `--locked`
error: failed to compile `cargo-chef v0.1.66`, intermediate artifacts can be found at `/tmp/cargo-installLhTp2j`

Caused by:
  package `clap_lex v0.7.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.69.0
  Try re-running cargo install with `--locked`
     Summary Failed to install wasm-pack, cargo-chef (see error(s) above).
error: some crates failed to install
Error: building at STEP "RUN set -x     && RUSTFLAGS=-Ctarget-feature=-crt-static cargo install wasm-pack cargo-chef     && rustup target add wasm32-unknown-unknown": while running runtime: exit status 101

@nitnelave
Copy link
Member

Oh, you're updating the Dockerfile in the root! Yeah, we don't regularly use this one, it's more for development. But it's nice to add it there as well, I guess? The image is a bit old. You can upgrade the base tag to alpine3.19 and it should fix the errors.

The Dockerfile you want to edit is in .github/workflows

@djjudas21
Copy link
Contributor Author

Forgive me, I don't have much experience with multi stage builds, but do I need to add the COPY line to the *-base Dockerfiles, and from there it will be available in all the other images, e.g. the rootless etc?

@nitnelave
Copy link
Member

You need to add it to the final image (the one with the comment "Final image" :) ). That's the one that contains the final binaries. The other image is just for compiling the binaries, so it contains the rust install, for instance. You don't need the bootstrap script there.

Dockerfile Show resolved Hide resolved
Copy link
Member

@nitnelave nitnelave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the bootstrap script to the scripts folder at the root, instead of in example_configs: now it's becoming official.

Dockerfile Outdated Show resolved Hide resolved
@djjudas21
Copy link
Contributor Author

Let's move the bootstrap script to the scripts folder at the root, instead of in example_configs: now it's becoming official.

Done in f7689bb

@djjudas21
Copy link
Contributor Author

I think this is ready for merge now. And please could you push an updated image, even if it's not a fully-fledged stable tag? Thanks

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Merging #885 (f7689bb) into main (533d1bc) will decrease coverage by 0.16%.
Report is 6 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #885      +/-   ##
==========================================
- Coverage   86.28%   86.13%   -0.16%     
==========================================
  Files          50       50              
  Lines       10925    10791     -134     
==========================================
- Hits         9427     9295     -132     
+ Misses       1498     1496       -2     

see 22 files with indirect coverage changes

@nitnelave nitnelave merged commit 6d65a25 into lldap:main Apr 1, 2024
16 of 17 checks passed
@nitnelave
Copy link
Member

There you go! It'll be part of the daily image by tomorrow.

@djjudas21 djjudas21 deleted the 884_bootstrap branch April 1, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Include bootstrap.sh in Docker image
2 participants