Skip to content

Commit

Permalink
fix: pre-build python-base layer first
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 21, 2024
1 parent bd7ed20 commit 3b6ea87
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

16 changes: 15 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,21 @@ export default function getCLI(context) {
const { extraFlags } = opts;
const latestRelease = await github.getLatestReleaseTag();
console.log(`Latest release: ${latestRelease}`);
const command = await docker.getDockerCommand({
let command;

// --------------------------------------------------------------------
console.log("Building python-base layer first to reduce parallelism");

Check failure on line 210 in src/cli.js

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
const tempOpts = { ...opts, preset: 'python-base' };
command = await docker.getDockerCommand({
...tempOpts, buildContext, buildContextRef, latestRelease, extraFlags,
});
context.log(command);
if (!opts.dryRun) {
utils.runShellCommand({ command, raiseOnError: false });
}
// --------------------------------------------------------------------

command = await docker.getDockerCommand({
...opts, buildContext, buildContextRef, latestRelease, extraFlags,
});
context.log(command);
Expand Down
2 changes: 2 additions & 0 deletions src/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export async function getDockerCommand({
} else if (preset === 'py310') {
buildTarget = 'lean';
pyVer = '3.10-slim-bookworm';
} else if (preset === 'python-base') {
buildTarget = 'python-base';
} else if (preset === 'py311') {
buildTarget = 'lean';
pyVer = '3.11-slim-bookworm';
Expand Down

0 comments on commit 3b6ea87

Please sign in to comment.