Skip to content

Commit 751d96a

Browse files
committed
initial
0 parents  commit 751d96a

File tree

15 files changed

+348
-0
lines changed

15 files changed

+348
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm",
3+
"customizations": {
4+
"vscode": {
5+
"settings": {
6+
"json.schemas": [
7+
{
8+
"fileMatch": ["*/devcontainer-feature.json"],
9+
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
10+
}
11+
]
12+
},
13+
"extensions": ["mads-hartmann.bash-ide-vscode"]
14+
}
15+
},
16+
"features": {
17+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
18+
},
19+
"remoteUser": "node",
20+
"updateContentCommand": "npm install -g @devcontainers/cli"
21+
}

.github/workflows/release.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Release dev container features & Generate Documentation"
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
deploy:
7+
if: ${{ github.ref == 'refs/heads/main' }}
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: "Publish Features"
17+
uses: devcontainers/action@v1
18+
with:
19+
publish-features: "true"
20+
base-path-to-features: "./src"
21+
generate-docs: "true"
22+
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Create PR for Documentation
27+
id: push_image_info
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
set -e
32+
echo "Start."
33+
# Configure git and Push updates
34+
git config --global user.email github-actions[bot]@users.noreply.github.com
35+
git config --global user.name github-actions[bot]
36+
git config pull.rebase false
37+
branch=automated-documentation-update-$GITHUB_RUN_ID
38+
git checkout -b $branch
39+
message='Automated documentation update'
40+
# Add / update and commit
41+
git add */**/README.md
42+
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
43+
# Push
44+
if [ "$NO_UPDATES" != "true" ] ; then
45+
git push origin "$branch"
46+
gh pr create --title "$message" --body "$message"
47+
fi

.github/workflows/test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "CI - Test Features"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
test-global:
11+
runs-on: ubuntu-latest
12+
continue-on-error: true
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: "Install latest devcontainer CLI"
17+
run: npm install -g @devcontainers/cli
18+
19+
- name: "Testing global scenarios"
20+
run: devcontainer features test --global-scenarios-only .

.github/workflows/validate.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Validate devcontainer-feature.json files"
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
6+
jobs:
7+
validate:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: "Validate devcontainer-feature.json files"
13+
uses: devcontainers/action@v1
14+
with:
15+
validate-only: "true"
16+
base-path-to-features: "./src"

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Dev Container Features for Noir Development
2+
3+
This repository contains [Dev Container Features](https://containers.dev/implementors/features/) for Noir language development. It provides out-of-the-box support for installing Noir's Nargo CLI and the Barretenberg library in your development containers.
4+
5+
## Available Features
6+
7+
This repository provides the following features:
8+
9+
### 1. Nargo CLI (`nargo`)
10+
11+
Installs the Noir language compiler and toolchain.
12+
13+
- **ID**: `nargo`
14+
- **Description**: Installs the Nargo CLI tool and its installer `noirup`
15+
- **Options**:
16+
- `version`: The version of Nargo to install (default: `latest`, can be set to `nightly` or a specific version)
17+
18+
### 2. Barretenberg (`bb`)
19+
20+
Installs the Barretenberg prover backend for Noir.
21+
22+
- **ID**: `bb`
23+
- **Description**: Installs the Barretenberg CLI tool and its installer `bbup`
24+
- **Options**:
25+
- `version`: The version of Barretenberg to install (default: `nargo`, meaning it will match with an existing Nargo installation)
26+
27+
## Usage
28+
29+
Add these features to your `devcontainer.json` file:
30+
31+
```json
32+
"features": {
33+
"ghcr.io/yourusername/feature-starter/nargo:1.0.0": {},
34+
"ghcr.io/yourusername/feature-starter/bb:1.0.0": {}
35+
}
36+
```
37+
38+
### Examples
39+
40+
Install the latest stable Nargo and Barretenberg:
41+
42+
```json
43+
"features": {
44+
"ghcr.io/signorecello/feature-starter/nargo:1.0.0": {},
45+
"ghcr.io/signorecello/feature-starter/bb:1.0.0": {}
46+
}
47+
```
48+
49+
Install the nightly version of Nargo and a specific version of Barretenberg:
50+
51+
```json
52+
"features": {
53+
"ghcr.io/signorecello/feature-starter/nargo:1.0.0": {
54+
"version": "nightly"
55+
},
56+
"ghcr.io/signorecello/feature-starter/bb:1.0.0": {
57+
"version": "0.80.0"
58+
}
59+
}
60+
```
61+
62+
## Development
63+
64+
This repository follows the [Dev Container Feature specification](https://containers.dev/implementors/features/).
65+
66+
### Testing
67+
68+
You can test the features using the Dev Container CLI:
69+
70+
```bash
71+
devcontainer features test --global-scenarios-only .
72+
```
73+
74+
## License
75+
76+
This project is available under the MIT license.

src/barretenberg/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# Barretenberg
3+
4+
A feature that installs the Barretenberg `cli` tool `bb` and its installer `bbup`.
5+
6+
## Example Usage
7+
8+
You can specify any version of `bb`, or leave empty to match with an existent version of `nargo` on the container.
9+
10+
```json
11+
"features": {
12+
"ghcr.io/devcontainers/feature/barretenberg:1": {
13+
"version": "0.80.0"
14+
}
15+
}
16+
```
17+
18+
## Options
19+
20+
| Options Id | Description | Type | Default Value |
21+
| ---------- | ---------------------- | ------ | ------------- |
22+
| version | The version to install | string | nargo |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "Barretenberg",
3+
"id": "bb",
4+
"version": "1.0.0",
5+
"description": "A feature to install Barretenberg",
6+
"options": {
7+
"version": {
8+
"type": "string",
9+
"default": "nargo",
10+
"description": "The version of Barretenberg to install. Defaults to the latest Nargo compatible version."
11+
}
12+
},
13+
"installsAfter": ["./noir"]
14+
}

src/barretenberg/install.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -e
3+
4+
echo "Installing Barretenberg"
5+
echo "The provided version is: ${VERSION}"
6+
7+
if [ "${VERSION}" != "" ]; then
8+
VERSION="-v ${VERSION}"
9+
fi
10+
11+
apt update && apt install -y curl bash git tar gzip libc++-dev unzip jq
12+
13+
echo "curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash" >> /etc/profile.d/noir.sh
14+
echo "\$HOME/.bb/bbup ${VERSION}" >> /etc/profile.d/noir.sh
15+
echo "PATH=\$HOME/.bb/bin:$PATH" >> /etc/profile.d/noir.sh

src/noir/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# Nargo
3+
4+
A feature that installs the Nargo `cli` tool `nargo` and its installer `noirup`.
5+
6+
## Example Usage
7+
8+
You can specify any version of `noir`, or leave empty to install the latest stable. Pass `nightly` for the latest nightly version.
9+
10+
```json
11+
"features": {
12+
"ghcr.io/devcontainers/feature/barretenberg:1": {
13+
"version": "nightly"
14+
}
15+
}
16+
```
17+
18+
## Options
19+
20+
| Options Id | Description | Type | Default Value |
21+
| ---------- | ---------------------- | ------ | ------------- |
22+
| version | The version to install | string | nargo |

src/noir/devcontainer-feature.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "Nargo",
3+
"id": "nargo",
4+
"version": "1.0.0",
5+
"description": "A feature to install Nargo",
6+
"options": {
7+
"version": {
8+
"type": "string",
9+
"default": "latest",
10+
"description": "The version of Nargo to install"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)