Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
45 changes: 45 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@
"dotenv": "^16.0.0",
"fs-extra": "^8.1.0",
"semver": "^7.5.2",
"p-retry": "^4.6.2",
"vscode-nls": "^4.1.1",
"vscode-uri": "^3.0.2"
},
Expand Down
18 changes: 15 additions & 3 deletions src/commands/image/imageSource/buildImageInAzure/RunStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

import { type DockerBuildRequest as AcrDockerBuildRequest } from "@azure/arm-containerregistry";
import { AzExtFsExtra, GenericTreeItem, activityFailContext, activityFailIcon } from "@microsoft/vscode-azext-utils";
import * as retry from 'p-retry';
import * as path from 'path';
import { type Progress } from "vscode";
import { ext } from "../../../../extensionVariables";
import { ExecuteActivityOutputStepBase, type ExecuteActivityOutput } from "../../../../utils/activity/ExecuteActivityOutputStepBase";
import { createActivityChildContext } from "../../../../utils/activity/activityUtils";
import { localize } from "../../../../utils/localize";
Expand All @@ -27,10 +29,20 @@ export class RunStep extends ExecuteActivityOutputStepBase<BuildImageInAzureImag
dockerFilePath: path.basename(context.dockerfilePath) /* Assume the dockerfile is always in the root of the source */
};

const building: string = localize('buildingImage', 'Building image...');
progress.report({ message: building });
const retries = 3;
await retry(
async (currentAttempt: number): Promise<void> => {
const message: string = currentAttempt === 1 ?
localize('buildingImage', 'Building image...') :
localize('buildingImageAttempt', 'Building image (Attempt {0}/{1})...', currentAttempt, retries + 1);
Comment thread
nturinski marked this conversation as resolved.
progress.report({ message: message });
ext.outputChannel.appendLog(message);
Comment thread
MicroFish91 marked this conversation as resolved.

context.run = await context.client.registries.beginScheduleRunAndWait(context.resourceGroupName, context.registryName, runRequest);
context.run = await context.client.registries.beginScheduleRunAndWait(context.resourceGroupName, context.registryName, runRequest);

},
{ retries, minTimeout: 2 * 1000 }
);
} finally {
if (await AzExtFsExtra.pathExists(context.tarFilePath)) {
await AzExtFsExtra.deleteResource(context.tarFilePath);
Expand Down