Skip to content

Commit

Permalink
fix: default build creation
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Mar 22, 2024
1 parent ec3eeb1 commit b5488f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/bolt-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive

- name: LFS
run: git lfs pull

- uses: ./.github/actions/pre-init
with:
SCCACHE_AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
Expand All @@ -37,10 +40,6 @@ jobs:
- name: Bolt Test
run: nix-shell --pure --run "bolt test"

- name: Tmate
if: failure()
uses: mxschmitt/action-tmate@v3

- name: K3D Cleanup
if: always()
run: nix-shell --pure --run "k3d cluster delete rivet-ci"
Expand Down
2 changes: 2 additions & 0 deletions infra/nix/bolt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = buildInputs;
doCheck = false;


shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.strings.makeLibraryPath [ pkgs.openssl ]}"
export RUSTFLAGS="--cfg tokio_unstable"
'';

# See https://artemis.sh/2023/07/08/nix-rust-project-with-git-dependencies.html
Expand Down
7 changes: 6 additions & 1 deletion svc/pkg/build/ops/create/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ async fn handle(

let (image_tag, upload_id, image_presigned_requests) =
if let Some(build_kind) = &ctx.default_build_kind {
let (image_tag, upload_id) = sql_fetch_one!(
let default_build_row = sql_fetch_optional!(
[ctx, (String, Uuid)]
"SELECT image_tag, upload_id FROM db_build.default_builds WHERE kind = $1",
build_kind,
)
.await?;

let (image_tag, upload_id) = unwrap!(
default_build_row,
format!("default build missing: {build_kind}")
);

(image_tag, upload_id, Vec::new())
} else {
let image_file = unwrap_ref!(ctx.image_file);
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/build/standalone/default-create/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async fn upload_build(
backend::upload::PrepareFile {
path: "image.tar".into(),
content_length: build.tar.len() as u64,
multipart: true,
multipart: false,
..Default::default()
},
],
Expand Down

0 comments on commit b5488f1

Please sign in to comment.