Skip to content

Implemented instance type #712

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Conversation

ekharkunov
Copy link
Contributor

@ekharkunov ekharkunov commented Apr 24, 2025

  • Implemented instance type configuration.
  • Implemented handling of 'mappings not found' error.

Now it's possible to configure instance type explicitly. Depends on instance type Extender define how to handle "non-existed sdk mapping" case.

Fixes #465
Fixes #720

this.remoteEngineBuilder.buildAsync(remoteInstanceConfig, uploadDirectory, platform, sdkVersion, jobDirectory, buildDirectory, metricsWriter);
} else {

if (instanceType.equals(InstanceType.BUILDER_ONLY)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If instance marked as "BUILDER_ONLY" - skip request for sdk mappings and start building.

try {
// sdk version was removed (dev or beta)
buildEnvDescription = ExtenderUtil.getSdksForPlatform(platform, defoldSdkService.getPlatformSdkMappings(sdkVersion));
} catch(ExtenderException exc) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exception happened if we can't find sdk mappings for given hash.

LOGGER.info("Building engine on remote builder");
RemoteInstanceConfig remoteInstanceConfig = getRemoteBuilderConfig(buildEnvDescription[0], buildEnvDescription[1]);
this.remoteEngineBuilder.buildAsync(remoteInstanceConfig, uploadDirectory, platform, sdkVersion, jobDirectory, buildDirectory, metricsWriter);
} else if (instanceType.equals(InstanceType.MIXED)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If sdk mappings exist but there are no required sdk version defined and instance marked as "MIXED" - try build on current instance.

asyncBuilder.asyncBuildEngine(metricsWriter, platform, sdkVersion, jobDirectory, uploadDirectory, buildDirectory);
} else {
// no remote buidler was found and current instance can't build
throw new NotSupportedException("Engine version unsupported. Please, update engine to the newer version.");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SDK mappings exists but no record for given sdk and version was found - throw error.

@ekharkunov ekharkunov requested a review from britzl April 24, 2025 20:05
} else if (instanceType.equals(InstanceType.MIXED)) {
asyncBuilder.asyncBuildEngine(metricsWriter, platform, sdkVersion, jobDirectory, uploadDirectory, buildDirectory);
} else {
// no remote buidler was found and current instance can't build
Copy link
Contributor

Choose a reason for hiding this comment

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

buidler -> builder

@ekharkunov ekharkunov marked this pull request as draft May 1, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants