Skip to content

Commit bc0c146

Browse files
authored
ci: add copilot instructions (#944)
* ci: add copilot instructions * docs: reduce duplication between readme and copilot-instructions * docs: minor improvements to readme
1 parent 2e2a537 commit bc0c146

File tree

2 files changed

+61
-43
lines changed

2 files changed

+61
-43
lines changed

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Project Overview
2+
3+
This repository contains devcontainers tailored towards modern software development.
4+
The containers try to be as "batteries included" as possible without being overly opinionated, and are usable for both local development and continuous integration.
5+
All containers are multi-platform and can be used on x64 (x86-64) and arm64 hardware on an operating system that supports an [OCI](https://opencontainers.org/) compatible container engine.
6+
This includes Windows, Linux, and macOS on both Intel and Apple silicon.
7+
8+
The devcontainers include modern, up-to-date, tooling for C++ and Rust development, and are fully compatible with GitHub Codespaces and Visual Studio Code.
9+
The containers are versioned using [Semantic Versioning](https://semver.org/) and are designed with supply-chain security in mind.
10+
They can be used with [Dependabot](https://dependabot.com/) to keep dependencies up to date.
11+
12+
The container images should provide a secure foundation for regulated software development in e.g. the medical, automotive, aviation, and railroad domains.
13+
14+
## Key Features
15+
16+
The key features of this project are described in the top-level README.md, read them from there to prevent duplication and mismatches.
17+
18+
## Folder Structure
19+
20+
The folder structure of amp-devcontainer is described below, adhere to the existing folder structure.
21+
22+
- `/.devcontainer`: Contains the source code for the container flavors with a top-level devcontainer.json file to enable `clone in container volume` of this repository.
23+
- `/.devcontainer/[flavor]`: Contains the Dockerfile and configuration for each container flavor (e.g., `cpp`, `rust`).
24+
- `/.devcontainer/[flavor]-test`: Contains a devcontainer.json file for testing the container flavor.
25+
- `/.github`: Contains the GitHub workflows for CI/CD, linter configuration, issue templates and re-usable actions.
26+
- `/test/[flavor]`: Contains [Bats](https://bats-core.readthedocs.io/en/stable/) integration- and Playwright verification tests for the containers.

README.md

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This repository contains [devcontainers](https://docs.github.com/en/codespaces/s
2929
### Key Features
3030

3131
- **Batteries Included** 🔋: Pre-configured tools for local development and continuous integration.
32+
- **Developer Experience** 👩‍💻: Minimal set-up time and maximal shift-left.
3233
- **Multi-platform Support** ⚙️: Compatible with x64 and arm64 hardware on Windows, Linux, and macOS.
3334
- **Image Flavors** 🍨: Dedicated containers for C++ and Rust development.
3435
- **IDE Integration** 💻: Fully compatible with GitHub Codespaces and VS Code.
@@ -38,7 +39,8 @@ This repository contains [devcontainers](https://docs.github.com/en/codespaces/s
3839

3940
The containers try to be as "batteries included" as possible without being overly opinionated, and are usable for both local development and continuous integration.
4041

41-
All containers are multi-platform and can be used on x64 (x86-64) and arm64 hardware on an operating system that supports an [OCI](https://opencontainers.org/) compatible container engine. This includes Windows, Linux, and macOS on both Intel and Apple silicon.
42+
All containers are multi-platform and can be used on x64 (x86-64) and arm64 hardware on an operating system that supports an [OCI](https://opencontainers.org/) compatible container engine.
43+
This includes Windows, Linux, and macOS on both Intel and Apple silicon.
4244

4345
## State
4446

@@ -53,9 +55,10 @@ The following devcontainers are published towards the [GitHub Container Registry
5355
- [amp-devcontainer-cpp](https://github.com/orgs/philips-software/packages/container/package/amp-devcontainer-cpp); the C++ container
5456
- [amp-devcontainer-rust](https://github.com/orgs/philips-software/packages/container/package/amp-devcontainer-rust); the Rust container
5557

56-
Both containers include a full [Visual Studio Code](https://code.visualstudio.com/) configuration that is compatible with [GitHub Codespaces](https://github.com/features/codespaces).
58+
All containers include a full [Visual Studio Code](https://code.visualstudio.com/) configuration that is compatible with [GitHub Codespaces](https://github.com/features/codespaces).
5759

58-
A summary of the included tools can be found below. For the full list of all included tools and tool versions see the [Dependency Graph](https://github.com/philips-software/amp-devcontainer/network/dependencies), the SBOM published with a [release](https://github.com/philips-software/amp-devcontainer/releases), or the SBOM attached to the image.
60+
A summary of the included tools can be found below.
61+
For the full list of all included tools and tool versions see the [Dependency Graph](https://github.com/philips-software/amp-devcontainer/network/dependencies), the SBOM published with a [release](https://github.com/philips-software/amp-devcontainer/releases), or the SBOM attached to the image.
5962

6063
#### amp-devcontainer-cpp
6164

@@ -75,7 +78,11 @@ For embedded development and flashing and debugging [probe-rs](https://probe.rs/
7578

7679
### Versioning
7780

78-
The amp-devcontainer repository follows a [semantic versioning](https://semver.org/spec/v2.0.0.html) strategy for its container images. This ensures clear communication of updates and compatibility. The versioning format used is `<major>.<minor>.<patch>`. Released containers are tagged with `<major>`, `<major>.<minor>`, `<major>.<minor>.<patch>` and `v<major>.<minor>.<patch>`. The latest build on the default branch is tagged with `edge` and pull request builds are tagged with `pr-<number>`.
81+
The amp-devcontainer repository follows a [semantic versioning](https://semver.org/spec/v2.0.0.html) strategy for its container images.
82+
This ensures clear communication of updates and compatibility.
83+
The versioning format used is `<major>.<minor>.<patch>`.
84+
Released containers are tagged with `<major>`, `<major>.<minor>`, `<major>.<minor>.<patch>` and `v<major>.<minor>.<patch>`.
85+
The latest build on the default branch is tagged with `edge` and pull request builds are tagged with `pr-<number>`.
7986

8087
| Branch | Tag |
8188
|--------------|----------------------------|
@@ -86,20 +93,33 @@ The amp-devcontainer repository follows a [semantic versioning](https://semver.o
8693
| | `<major>.<minor>` |
8794
| | `<major>` |
8895

89-
Released containers will never be cleaned-up, pull request builds are cleaned up when the pull request is merged, and edge builds may be cleaned up after being stale for a while.
96+
Released containers will never be cleaned-up, pull request builds are cleaned up when the pull request is closed, and edge builds will be cleaned up shortly after a new edge version has been published.
9097

91-
The release notes always contain an overview of the corresponding image versions that include the full SHA next to the version number. This makes it possible for humans to easily see what version is used while still pinning to an exact version. This is the recommended way to refer to an image.
98+
The release notes always contain an overview of the corresponding image versions that include the full SHA next to the version number.
99+
This makes it possible for humans to easily see what version is used while still pinning to an exact version.
100+
This is the recommended way to refer to an image.
92101

93-
All container images are included in a release. This might change in the future when the need arises to have separate releases per container.
102+
All container images are included in a release.
103+
This might change in the future when the need arises to have separate releases per container.
94104

95-
This versioning strategy is implemented as GitHub Actions workflows, ensuring consistency and security across releases. Only the GitHub Action workflow is allowed to create a release, and the resulting images are [signed](#verify-image-signature).
105+
This versioning strategy is implemented as GitHub Actions workflows, ensuring consistency and security across releases.
106+
Only the GitHub Action workflow is allowed to create a release, and the resulting images are [signed](#verify-image-signature).
96107

97108
### Visual Studio Code
98109

99-
Both containers can be used in Visual Studio Code or GitHub Codespaces without any additional configuration. All included tools are set-up and necessary plug-ins will be installed at container start. This behavior is implemented by appending devcontainer metadata to an image label according to these [specifications](https://containers.dev/implementors/reference/#labels). It is possible to override, amend or change the options following this [merge logic](https://containers.dev/implementors/spec/#merge-logic).
110+
All containers can be used in Visual Studio Code or GitHub Codespaces without any additional configuration.
111+
All included tools are preconfigured and necessary plug-ins will be installed at container start.
112+
This behavior is implemented by appending devcontainer metadata to an image label according to these [specifications](https://containers.dev/implementors/reference/#labels).
113+
It is possible to override, amend or change the options following this [merge logic](https://containers.dev/implementors/spec/#merge-logic).
100114

101115
## Usage
102116

117+
This chapter describes how to use amp-devcontainer for two common use-cases, and details how to verify the signature of the container images.
118+
119+
> [!IMPORTANT]
120+
> While the following examples use the `latest` tag, it is recommended to pin to a specific version using vX.Y.Z. Or better yet, a specific SHA.
121+
> See the 🔖 Packages section on the [releases](https://github.com/philips-software/amp-devcontainer/releases) page for the unambiguous identifier corresponding to a specific release.
122+
103123
### Verify image signature
104124

105125
<details><summary>Prior to version 5.6.0</summary>
@@ -108,16 +128,10 @@ The container images are signed with [SigStore](https://www.sigstore.dev/) [Cosi
108128

109129
The signature can be [verified](https://docs.sigstore.dev/cosign/verifying/verify/) with the following command (using Docker), verifying that the image is actually signed by the GitHub CI system:
110130

111-
> amp-devcontainer-cpp
112-
113-
```sh
114-
docker run --rm gcr.io/projectsigstore/cosign verify ghcr.io/philips-software/amp-devcontainer-cpp --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp https://github.com/philips-software/amp-devcontainer
115-
```
116-
117-
> amp-devcontainer-rust
131+
> amp-devcontainer-<🍨 flavor>
118132
119133
```sh
120-
docker run --rm gcr.io/projectsigstore/cosign verify ghcr.io/philips-software/amp-devcontainer-rust --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp https://github.com/philips-software/amp-devcontainer
134+
docker run --rm gcr.io/projectsigstore/cosign verify ghcr.io/philips-software/amp-devcontainer-<🍨 flavor> --certificate-oidc-issuer https://token.actions.githubusercontent.com --certificate-identity-regexp https://github.com/philips-software/amp-devcontainer
121135
```
122136

123137
</details>
@@ -126,43 +140,21 @@ The container images are signed using the [attest-build-provenance](https://gith
126140

127141
The attestations can be checked with the following command, verifying that the image is actually built by the GitHub CI system:
128142

129-
> amp-devcontainer-cpp
143+
> amp-devcontainer-<🍨 flavor>
130144
131145
```sh
132-
gh attestation verify --repo philips-software/amp-devcontainer oci://ghcr.io/philips-software/amp-devcontainer-cpp
133-
```
134-
135-
> amp-devcontainer-rust
136-
137-
```sh
138-
gh attestation verify --repo philips-software/amp-devcontainer oci://ghcr.io/philips-software/amp-devcontainer-rust
146+
gh attestation verify --repo philips-software/amp-devcontainer oci://ghcr.io/philips-software/amp-devcontainer-<🍨 flavor>
139147
```
140148

141149
### Local development
142150

143151
The resulting containers can be used in a `.devcontainer.json` file or in a `.devcontainer` folder.
144152

145-
> [!NOTE]
146-
> While the following examples use the `latest` tag, it is recommended to pin to a specific version. Or better yet, a specific SHA.
147-
> See the [releases](https://github.com/philips-software/amp-devcontainer/releases) for the SHA corresponding to a specific release.
148-
149-
#### amp-devcontainer-cpp
150-
151-
> .devcontainer/devcontainer.json or .devcontainer.json
152-
153-
```json
154-
{
155-
"image": "ghcr.io/philips-software/amp-devcontainer-cpp:latest"
156-
}
157-
```
158-
159-
#### amp-devcontainer-rust
160-
161153
> .devcontainer/devcontainer.json or .devcontainer.json
162154
163155
```json
164156
{
165-
"image": "ghcr.io/philips-software/amp-devcontainer-rust:latest"
157+
"image": "ghcr.io/philips-software/amp-devcontainer-<🍨 flavor>:latest"
166158
}
167159
```
168160

@@ -174,7 +166,7 @@ The resulting containers can be used in a GitHub workflow by using the [`contain
174166
jobs:
175167
container-job:
176168
runs-on: ubuntu-latest
177-
container: ghcr.io/philips-software/amp-devcontainer-cpp:latest
169+
container: ghcr.io/philips-software/amp-devcontainer-<🍨 flavor>:latest
178170
```
179171
180172
## Community

0 commit comments

Comments
 (0)