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

Workaround missing aws CLI on self-hosted runners by running the Cloud tests on GH runners #10977

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/extra-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./run backend test std-snowflake
env:
ENSO_CLOUD_COGNITO_REGION: ${{ secrets.ENSO_CLOUD_COGNITO_REGION }}
ENSO_CLOUD_COGNITO_USER_POOL_ID: ${{ secrets.ENSO_CLOUD_COGNITO_USER_POOL_ID }}
ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID: ${{ secrets.ENSO_CLOUD_COGNITO_USER_POOL_WEB_CLIENT_ID }}
ENSO_CLOUD_TEST_ACCOUNT_PASSWORD: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_PASSWORD }}
ENSO_CLOUD_TEST_ACCOUNT_USERNAME: ${{ secrets.ENSO_CLOUD_TEST_ACCOUNT_USERNAME }}
ENSO_SNOWFLAKE_ACCOUNT: ${{ secrets.ENSO_SNOWFLAKE_ACCOUNT }}
ENSO_SNOWFLAKE_DATABASE: ${{ secrets.ENSO_SNOWFLAKE_DATABASE }}
ENSO_SNOWFLAKE_PASSWORD: ${{ secrets.ENSO_SNOWFLAKE_PASSWORD }}
Expand Down Expand Up @@ -81,10 +76,9 @@ jobs:
permissions:
checks: write
enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-linux-amd64:
name: Standard Library Tests (GraalVM CE) (linux, amd64)
name: Standard Library Tests (GraalVM CE) (LinuxLatest)
runs-on:
- self-hosted
- Linux
- ubuntu-latest
steps:
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
name: Installing wasm-pack
Expand Down
2 changes: 1 addition & 1 deletion build/build/src/ci_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ pub fn extra_nightly_tests() -> Result<Workflow> {

// We run the extra tests only on Linux, as they should not contain any platform-specific
// behavior.
let target = (OS::Linux, Arch::X86_64);
let target = PRIMARY_TARGET;
workflow.add(target, job::SnowflakeTests {});
workflow.add(target, job::StandardLibraryTests {
graal_edition: graalvm::Edition::Community,
Expand Down
42 changes: 35 additions & 7 deletions build/build/src/ci_gen/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ impl JobArchetype for StandardLibraryTests {
let graal_edition = self.graal_edition;
let should_enable_cloud_tests = self.cloud_tests_enabled;
let job_name = format!("Standard Library Tests ({graal_edition})");
let mut job = RunStepsBuilder::new("backend test standard-library")
.customize(move |step| {
let run_steps_builder =
RunStepsBuilder::new("backend test standard-library").customize(move |step| {
let main_step = step
.with_secret_exposed_as(
secret::ENSO_LIB_S3_AWS_REGION,
Expand All @@ -268,9 +268,14 @@ impl JobArchetype for StandardLibraryTests {
};

vec![updated_main_step, step::stdlib_test_reporter(target, graal_edition)]
})
.build_job(job_name, target)
.with_permission(Permission::Checks, Access::Write);
});
let mut job = build_job_ensuring_cloud_tests_run_on_github(
run_steps_builder,
target,
&job_name,
should_enable_cloud_tests,
)
.with_permission(Permission::Checks, Access::Write);
match graal_edition {
graalvm::Edition::Community => job.env(env::GRAAL_EDITION, graalvm::Edition::Community),
graalvm::Edition::Enterprise =>
Expand All @@ -288,6 +293,26 @@ impl JobArchetype for StandardLibraryTests {
}
}

/** This is a temporary workaround.
*
* The Cloud tests preparation requires `aws` CLI to be installed on the machine.
* The GitHub hosted runners have it, but our self-hosted runners do not.
* To fix this we either need to modify self-hosted runners to provide the AWS CLI or change the
* way we prepare the Cloud tests to not require it.
*/
fn build_job_ensuring_cloud_tests_run_on_github(
run_steps_builder: RunStepsBuilder,
target: Target,
job_name: &str,
cloud_tests_enabled: bool,
) -> Job {
if cloud_tests_enabled {
run_steps_builder.build_job(job_name, RunnerLabel::LinuxLatest)
} else {
run_steps_builder.build_job(job_name, target)
}
}

#[derive(Clone, Copy, Debug)]
pub struct SnowflakeTests {}

Expand Down Expand Up @@ -324,10 +349,13 @@ impl JobArchetype for SnowflakeTests {
crate::libraries_tests::snowflake::env::ENSO_SNOWFLAKE_WAREHOUSE,
);

let updated_main_step = enable_cloud_tests(main_step);
// Temporarily disabled until we can get the Cloud auth fixed.
// Snowflake does not rely on cloud anyway, so it can be disabled.
// But it will rely once we add datalink tests, so this should be fixed soon.
// let updated_main_step = enable_cloud_tests(main_step);

vec![
updated_main_step,
main_step,
step::extra_stdlib_test_reporter(target, GRAAL_EDITION_FOR_EXTRA_TESTS),
]
})
Expand Down
Loading