Skip to content

Commit

Permalink
Merge branch 'main' into fix/propagate-cache-from
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi authored Mar 26, 2024
2 parents 5f607e7 + 1da368b commit b2a4c4f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
environment: ci
steps:
- name: Checkout Actions
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: "microsoft/vscode-github-triage-actions"
path: ./actions
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/dev-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
name: CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
Expand All @@ -33,7 +33,7 @@ jobs:
echo "TGZ=devcontainers-cli-${VERSION}.tgz" | tee -a $GITHUB_ENV
echo "TGZ_UPLOAD=devcontainers-cli-${VERSION}-${GITHUB_SHA:0:8}.tgz" | tee -a $GITHUB_ENV
- name: Store TGZ
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TGZ_UPLOAD }}
path: ${{ env.TGZ }}
Expand Down Expand Up @@ -61,9 +61,9 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
Expand All @@ -88,9 +88,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-dev-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -33,7 +33,7 @@ jobs:
echo "TGZ=devcontainers-cli-${VERSION}.tgz" | tee -a $GITHUB_ENV
echo "TGZ_UPLOAD=devcontainers-cli-${VERSION}-${GITHUB_SHA:0:8}.tgz" | tee -a $GITHUB_ENV
- name: Download TGZ
uses: dawidd6/action-download-artifact@6f8f427fb41886a66b82ea11a5a15d1454c79415
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: dev-containers.yml
workflow_conclusion: success
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-plan-item-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- name: Checkout Actions
if: contains(github.event.issue.labels.*.name, 'testplan-item') || contains(github.event.issue.labels.*.name, 'invalid-testplan-item')
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: stable
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Notable changes.

## March 2024

### [0.58.0]
- Allow empty value for remote env. (https://github.com/devcontainers/ci/issues/231)
- Add generate-docs subcommand for templates and features. (https://github.com/devcontainers/cli/pull/759)
- Only use SELinux label for Linux hosts. (https://github.com/devcontainers/cli/issues/776)

### [0.57.0]
- Fix crash updating UID/GID when the image's platform is different from the native CPU arch (https://github.com/devcontainers/cli/pull/746)
- Add tags with build command (https://github.com/devcontainers/ci/issues/271)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@devcontainers/cli",
"description": "Dev Containers CLI",
"version": "0.57.0",
"version": "0.58.0",
"bin": {
"devcontainer": "devcontainer.js"
},
Expand Down
5 changes: 3 additions & 2 deletions src/spec-configuration/containerFeaturesConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ function escapeQuotesForShell(input: string) {

export function getFeatureLayers(featuresConfig: FeaturesConfig, containerUser: string, remoteUser: string, isBuildah = false, useBuildKitBuildContexts = false, contentSourceRootPath = '/tmp/build-features') {

const useSELinuxLabel = process.platform === 'linux' && isBuildah;
const builtinsEnvFile = `${path.posix.join(FEATURES_CONTAINER_TEMP_DEST_FOLDER, 'devcontainer-features.builtin.env')}`;
let result = `RUN \\
echo "_CONTAINER_USER_HOME=$(${getEntPasswdShellCommand(containerUser)} | cut -d: -f6)" >> ${builtinsEnvFile} && \\
Expand All @@ -312,7 +313,7 @@ RUN chmod -R 0755 ${dest} \\
`;
} else {
result += `RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${source},target=/tmp/build-features-src/${folder}${isBuildah ? ',z' : ''} \\
result += `RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${source},target=/tmp/build-features-src/${folder}${useSELinuxLabel ? ',z' : ''} \\
cp -ar /tmp/build-features-src/${folder} ${FEATURES_CONTAINER_TEMP_DEST_FOLDER} \\
&& chmod -R 0755 ${dest} \\
&& cd ${dest} \\
Expand Down Expand Up @@ -340,7 +341,7 @@ RUN chmod -R 0755 ${dest} \\
`;
} else {
result += `
RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${source},target=/tmp/build-features-src/${feature.consecutiveId}${isBuildah ? ',z' : ''} \\
RUN --mount=type=bind,from=dev_containers_feature_content_source,source=${source},target=/tmp/build-features-src/${feature.consecutiveId}${useSELinuxLabel ? ',z' : ''} \\
cp -ar /tmp/build-features-src/${feature.consecutiveId} ${FEATURES_CONTAINER_TEMP_DEST_FOLDER} \\
&& chmod -R 0755 ${dest} \\
&& cd ${dest} \\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"features": {
"terraform": "latest",
"ghcr.io/devcontainers/features/docker-in-docker@sha256:e32e8937c87345ff7a937d22cacb7f395d41deffde9943291ef3cc0ac91a8ac6": {},
"ghcr.io/devcontainers/features/docker-in-docker@sha256:440bdb81cf8af43f3e922450d33db9775c1097340557a5b7b6fe705bc758c5ef": {},
"node": "16"
}
}
4 changes: 4 additions & 0 deletions src/test/container-features/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ describe('Dev Container Features E2E (remote)', function () {
for (let i = 2; i >= 0; i--) {
try {
const res = await shellExec(`${cli} exec --workspace-folder ${testFolder} docker ps`);
await shellExec(`${cli} exec --workspace-folder ${testFolder} ps ax`);
assert.isNull(res.error);
assert.match(res.stdout, /CONTAINER ID/);
break;
} catch (err) {
await shellExec(`${cli} exec --workspace-folder ${testFolder} ps ax`);
if (i === 0) {
throw err;
}
Expand Down Expand Up @@ -111,10 +113,12 @@ describe('Dev Container Features E2E (remote)', function () {
for (let i = 2; i >= 0; i--) {
try {
const res = await shellExec(`${cli} exec --workspace-folder ${testFolder} docker ps`);
await shellExec(`${cli} exec --workspace-folder ${testFolder} ps ax`);
assert.isNull(res.error);
assert.match(res.stdout, /CONTAINER ID/);
break;
} catch (err) {
await shellExec(`${cli} exec --workspace-folder ${testFolder} ps ax`);
if (i === 0) {
throw err;
}
Expand Down

0 comments on commit b2a4c4f

Please sign in to comment.