Skip to content

Commit fec9a76

Browse files
committed
fix: deploy requirements
1 parent 3141945 commit fec9a76

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

build/build/src/ci_gen/job.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ pub struct DeployYdocPolyglot;
462462
impl JobArchetype for DeployYdocPolyglot {
463463
fn job(&self, target: Target) -> Job {
464464
ecr_deploy_steps_builder("release deploy-ydoc-polyglot")
465+
.cleaning(RELEASE_CLEANING_POLICY)
465466
.build_job("Upload polyglot Ydoc to ECR", target)
466467
}
467468
}
@@ -472,6 +473,7 @@ pub struct DeployYdocNodejs;
472473
impl JobArchetype for DeployYdocNodejs {
473474
fn job(&self, target: Target) -> Job {
474475
ecr_deploy_steps_builder("release deploy-ydoc-nodejs")
476+
.cleaning(RELEASE_CLEANING_POLICY)
475477
.build_job("Upload Node.js Ydoc to ECR", target)
476478
}
477479
}

build/build/src/engine.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ pub struct BuildConfigurationFlags {
199199
pub build_engine_package: bool,
200200
/// Build the NI Engine Runner.
201201
pub build_native_runner: bool,
202+
/// Build the Ydoc Native Image
203+
pub build_native_ydoc: bool,
202204
/// Build the experimental Espresso+NI Engine Runner.
203205
pub build_espresso_runner: bool,
204206
pub build_launcher_package: bool,
@@ -306,6 +308,7 @@ impl Default for BuildConfigurationFlags {
306308
build_engine_package: false,
307309
build_launcher_package: false,
308310
build_native_runner: false,
311+
build_native_ydoc: false,
309312
build_espresso_runner: false,
310313
build_project_manager_package: false,
311314
build_launcher_bundle: false,

build/build/src/engine/context.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ impl RunContext {
336336
if self.config.build_native_runner {
337337
tasks.push("engine-runner/buildNativeImage");
338338
}
339+
if self.config.build_native_ydoc {
340+
tasks.push("ydoc-server/buildNativeImage");
341+
}
339342
if self.config.build_project_manager_package() {
340343
tasks.push("buildProjectManagerDistribution");
341344
}

build/build/src/release.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::prelude::*;
44

55
use crate::changelog::Changelog;
66
use crate::context::BuildContext;
7-
use crate::engine;
87
use crate::env::ENSO_ADMIN_TOKEN;
98
use crate::paths::generated;
109
use crate::paths::TargetTriple;
@@ -17,7 +16,6 @@ use crate::version::Versions;
1716
use ide_ci::github;
1817
use ide_ci::io::web::handle_error_response;
1918
use ide_ci::programs::Docker;
20-
use ide_ci::programs::Pnpm;
2119
use ide_ci::programs::SevenZip;
2220
use octocrab::models::repos::Release;
2321
use octocrab::params::repos::Reference;
@@ -295,15 +293,9 @@ pub async fn deploy_runtime_to_ecr(context: &BuildContext, repository: String) -
295293
///
296294
/// Builds the polyglot Ydoc image and pushes it to our ECR.
297295
pub async fn deploy_ydoc_polyglot_to_ecr(context: &BuildContext, repository: String) -> Result {
298-
let sbt = engine::sbt::Context {
299-
repo_root: context.repo_root.path.clone(),
300-
system_properties: default(),
301-
};
302-
sbt.call_arg("ydoc-server/buildNativeImage").await?;
303296
let client = crate::aws::ecr::client_from_env().await;
304297
let repository_uri = crate::aws::ecr::get_repository_uri(&client, &repository).await?;
305-
let tag_name = repository_uri.replace("/runtime", "/ydoc-polyglot");
306-
let tag = format!("{}:{}", tag_name, context.triple.versions.version);
298+
let tag = format!("{}/{}:{}", repository_uri, "ydoc-polyglot", context.triple.versions.version);
307299
// We don't care about the image ID, we will refer to it by the tag.
308300
let _image_id = generate_ydoc_polyglot_image(context, &tag).await?;
309301
let credentials = crate::aws::ecr::get_credentials(&client).await?;
@@ -315,12 +307,9 @@ pub async fn deploy_ydoc_polyglot_to_ecr(context: &BuildContext, repository: Str
315307
///
316308
/// Builds the Node.js Ydoc image and pushes it to our ECR.
317309
pub async fn deploy_ydoc_nodejs_to_ecr(context: &BuildContext, repository: String) -> Result {
318-
Pnpm.cmd()?.install().run_ok().await?;
319-
Pnpm.cmd()?.run("-r").arg("compile").run_ok().await?;
320310
let client = crate::aws::ecr::client_from_env().await;
321311
let repository_uri = crate::aws::ecr::get_repository_uri(&client, &repository).await?;
322-
let tag_name = repository_uri.replace("/runtime", "/ydoc-nodejs");
323-
let tag = format!("{}:{}", tag_name, context.triple.versions.version);
312+
let tag = format!("{}/{}:{}", repository_uri, "ydoc-nodejs", context.triple.versions.version);
324313
// We don't care about the image ID, we will refer to it by the tag.
325314
let _image_id = generate_ydoc_nodejs_image(context, &tag).await?;
326315
let credentials = crate::aws::ecr::get_credentials(&client).await?;

build/cli/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ use ide_ci::programs::git;
7373
use ide_ci::programs::git::clean;
7474
use ide_ci::programs::rustc;
7575
use ide_ci::programs::Cargo;
76+
use ide_ci::programs::Pnpm;
7677
use octocrab::models::ReleaseId;
7778
use std::time::Duration;
7879
use tokio::process::Child;
@@ -786,10 +787,24 @@ pub async fn main_internal(config: Option<Config>) -> Result {
786787
.await?;
787788
}
788789
Action::DeployYdocPolyglot(args) => {
790+
let config = enso_build::engine::BuildConfigurationFlags {
791+
build_native_ydoc: true,
792+
..default()
793+
};
794+
let backend_context = ctx.prepare_backend_context(config).await?;
795+
backend_context.build().await?;
796+
789797
enso_build::release::deploy_ydoc_polyglot_to_ecr(&ctx, args.ecr_repository).await?;
790798
// TODO: dispatch cloud workflow
791799
}
792800
Action::DeployYdocNodejs(args) => {
801+
enso_build::web::install(&ctx.repo_root).await?;
802+
Pnpm.cmd()?
803+
.with_current_dir(&ctx.repo_root)
804+
.run("-r")
805+
.arg("compile")
806+
.run_ok()
807+
.await?;
793808
enso_build::release::deploy_ydoc_nodejs_to_ecr(&ctx, args.ecr_repository).await?;
794809
// TODO: dispatch cloud workflow
795810
}

0 commit comments

Comments
 (0)