Repository navigation
Adds devcontainer config files #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4b379e5
Add essential packages to apt-packages.txt
kenorb 40142a5
Update requests version to 2.32.5
kenorb e239bed
Add Ansible playbook for dev container provisioning
kenorb 2957c60
Create requirements-ansible.txt for dependencies
kenorb 3aa050f
Add Dockerfile for devcontainer setup
kenorb 417a9d3
Update devcontainer configuration and dependencies
kenorb 2799600
Add CI workflow for development containers
kenorb 63205bf
Add GitHub Actions workflow for Copilot setup
kenorb 6c75bbe
Remove check-json hook from pre-commit config
kenorb bcb9e09
Upgrade ansible-lint and markdownlint versions
kenorb bc634f6
Add VSCode settings for terminal auto-approval of pre-commit hooks
kenorb 013d44a
Remove unused pre-commit hooks and ensure proper formatting in config…
kenorb 44381f5
Refactor shfmt installation command in GitHub Actions workflow
kenorb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # See here for image contents: https://github.com/devcontainers/images/tree/main/src/base-ubuntu | ||
|
|
||
| # [Choice] Ubuntu version: noble, jammy, focal | ||
| ARG VARIANT="jammy" | ||
| FROM mcr.microsoft.com/devcontainers/base:${VARIANT} | ||
|
|
||
| # [Optional] Uncomment this section to install additional OS packages. | ||
| # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
| # && apt-get -y install --no-install-recommends <your-package-list-here> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| coreutils | ||
| direnv | ||
| figlet | ||
| findutils | ||
| gh | ||
| git | ||
| links | ||
| mawk | ||
| minizinc | ||
| sed | ||
| time | ||
| vim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,58 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
| // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
| { | ||
| // "build": { | ||
| // "dockerfile": "Dockerfile", | ||
| // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 | ||
| // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. | ||
| // "args": { "VARIANT": "ubuntu-22.04" } | ||
| // }, | ||
| // Configure tool-specific properties. | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "DavidAnson.vscode-markdownlint", | ||
| "GitHub.copilot", | ||
| "GitHub.copilot-chat", | ||
| "elagil.pre-commit-helper", | ||
| "formulahendry.code-runner", | ||
| "formulahendry.code-runner-copilot", | ||
| "github.vscode-github-actions", | ||
| "ms-python.python", | ||
| "vscodevim.vim" | ||
| ], | ||
| } | ||
| }, | ||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||
| "features": { | ||
| // "ghcr.io/maks1ms/devcontainers-features/wine:0": {}, | ||
| "ghcr.io/devcontainers-contrib/features/actionlint:1": {}, | ||
| "ghcr.io/devcontainers-extra/features/pipx-package:1": {}, | ||
| "ghcr.io/devcontainers/features/python:1": {}, | ||
| "ghcr.io/guiyomh/features/vim:0": {}, | ||
| "ghcr.io/jungaretti/features/ripgrep:1": {}, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
| }, | ||
| // Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
| // "forwardPorts": [], | ||
| // Use 'postCreateCommand' to run commands after the container is created. | ||
| // "postCreateCommand": "uname -a", | ||
| // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
| "image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
| "name": "dotfiles", | ||
| // Install dependencies and pre-commit hooks. | ||
| "postCreateCommand": "pip install -r .devcontainer/requirements.txt && pre-commit install", | ||
| // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
| "remoteUser": "vscode" | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "args": { | ||
| "VARIANT": "noble" | ||
| } | ||
| }, | ||
|
|
||
| // Configure tool-specific properties. | ||
| // Note: Keep the list in alphabetical order. | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "bierner.markdown-mermaid", | ||
| "DavidAnson.vscode-markdownlint", | ||
| "GitHub.copilot", | ||
| "GitHub.copilot-chat", | ||
| "GitHub.vscode-github-actions", | ||
| "ms-vscode.vscode-chat-customizations-evaluations", | ||
| "vscodevim.vim", | ||
| "vsls-contrib.codetour", | ||
| "xaver.clang-format" | ||
| ] | ||
| } | ||
| }, | ||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||
| "features": { | ||
| "ghcr.io/devcontainers-contrib/features/actionlint:1": {}, | ||
| "ghcr.io/devcontainers-contrib/features/node-asdf:0": {}, | ||
| "ghcr.io/devcontainers-extra/features/pipx-package:1": {}, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
| "ghcr.io/devcontainers/features/python:1": {}, | ||
| "ghcr.io/guiyomh/features/vim:0": {}, | ||
| "ghcr.io/jungaretti/features/make:1": {}, | ||
| "ghcr.io/jungaretti/features/ripgrep:1": {}, | ||
| "ghcr.io/prulloac/devcontainer-features/pre-commit:1": {}, | ||
| "ghcr.io/sliekens/devcontainer-features/opencode:1": {} | ||
| }, | ||
|
|
||
| // Pre-create host directories so OpenCode can bind-mount persistent config and cache data into the container | ||
| "initializeCommand": "mkdir -p \"$HOME/.local/share/opencode\" \"$HOME/.config/opencode\"", | ||
|
|
||
| // Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
| // "forwardPorts": [], | ||
|
|
||
| // Use 'postCreateCommand' to run commands after the container is created. | ||
| // "postCreateCommand": "uname -a", | ||
|
|
||
| // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
| // "image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
|
|
||
| // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
| "remoteUser": "vscode", | ||
| // Note: Python dependencies can be added in the `requirements.txt` file. | ||
| "onCreateCommand": "sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ansible && ansible-playbook .devcontainer/provision.yml" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| # Ansible playbook file. | ||
| # Usage: ansible-playbook .devcontainer/provision.yml | ||
| # Note: Keep keys and lists in alphabetical order. | ||
| - name: Provision dev container | ||
| hosts: localhost | ||
| connection: local | ||
| become: true | ||
| tasks: | ||
| - name: Load apt packages from file | ||
| ansible.builtin.set_fact: | ||
| apt_packages: >- | ||
| {{ lookup('file', playbook_dir + '/apt-packages.txt').splitlines() | ||
| | map('trim') | reject('equalto', '') | reject('match', '^#') | list }} | ||
| - name: Update apt cache | ||
| ansible.builtin.apt: | ||
| update_cache: true | ||
| - name: Install apt packages | ||
| ansible.builtin.apt: | ||
| name: '{{ apt_packages }}' | ||
| state: present | ||
| - name: Install ansible via pipx | ||
| ansible.builtin.command: pipx install --include-deps ansible | ||
| args: | ||
| creates: '{{ ansible_env.HOME }}/.local/bin/ansible' | ||
| become: false | ||
| - name: Inject ansible python requirements | ||
| ansible.builtin.command: | ||
| argv: | ||
| - pipx | ||
| - runpip | ||
| - ansible | ||
| - install | ||
| - -r | ||
| - '{{ playbook_dir }}/requirements-ansible.txt' | ||
| become: false | ||
| register: pipx_runpip | ||
| changed_when: "'Successfully installed' in (pipx_runpip.stdout + pipx_runpip.stderr)" | ||
| failed_when: pipx_runpip.rc != 0 | ||
| - name: Install python requirements | ||
| ansible.builtin.pip: | ||
| requirements: '{{ playbook_dir }}/requirements.txt' | ||
| extra_args: --break-system-packages --user | ||
| state: present | ||
| become: false | ||
| - name: Install pre-commit hooks | ||
| ansible.builtin.command: pre-commit install | ||
| args: | ||
| chdir: '{{ playbook_dir }}/..' | ||
| creates: .git/hooks/pre-commit | ||
| become: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Python packages injected into the pipx-managed Ansible environment. | ||
| # Keep dependencies sorted alphabetically. | ||
| docker>=7.1 | ||
| requests==2.32.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| # Python's requirements | ||
| # Usage: pip install -r requirements.txt | ||
| # Note: Keep dependencies sorted alphabetically. | ||
| ansible | ||
| ansible-lint | ||
| argcomplete>=1.9.4 | ||
| docker>=7.1 | ||
| jinja2-cli | ||
| molecule | ||
| molecule-docker | ||
| pipenv | ||
| pre-commit | ||
| requests==2.31.0 | ||
| requests==2.32.5 | ||
| uv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| # GitHub Copilot cloud agent customization. | ||
| # <https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent/customize-the-agent-environment> | ||
| name: Copilot Setup Steps | ||
| env: | ||
| # Pin external repositories to specific SHAs for reproducibility. | ||
| COGNI_AI_AGENTS_REF: main | ||
| COGNI_AI_AGENT_INSTRUCTIONS_REF: main | ||
| COGNI_AI_AGENT_SKILLS_REF: main | ||
| # yamllint disable-line rule:truthy | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| paths: | ||
| - .github/workflows/copilot-setup-steps.yml | ||
| - .devcontainer/requirements.txt | ||
| pull_request: | ||
| paths: | ||
| - .github/workflows/copilot-setup-steps.yml | ||
| - .devcontainer/requirements.txt | ||
| jobs: | ||
| copilot-setup-steps: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Clone agents | ||
| run: | | ||
| git clone --branch "$COGNI_AI_AGENTS_REF" --depth=1 \ | ||
| https://github.com/Cogni-AI-OU/cogni-ai-agents \ | ||
| "$HOME/.copilot/agents" | ||
| - name: Clone instructions | ||
| run: | | ||
| git clone --branch "$COGNI_AI_AGENT_INSTRUCTIONS_REF" --depth=1 \ | ||
| https://github.com/Cogni-AI-OU/cogni-ai-agent-instructions \ | ||
| "$HOME/.copilot/instructions" | ||
| - name: Clone skills | ||
| run: | | ||
| git clone --branch "$COGNI_AI_AGENT_SKILLS_REF" --depth=1 \ | ||
| https://github.com/Cogni-AI-OU/cogni-ai-agent-skills \ | ||
| "$HOME/.copilot/skills" | ||
| - uses: actions/setup-python@v6.2.0 | ||
| with: | ||
| cache: >- | ||
| ${{ hashFiles('.devcontainer/requirements.txt', 'requirements.txt', | ||
| '**/pyproject.toml') != '' && 'pip' || '' }} | ||
| cache-dependency-path: | | ||
| .devcontainer/requirements.txt | ||
| requirements.txt | ||
| **/pyproject.toml | ||
| python-version: '3.12' | ||
| - name: Restore Python user site | ||
| id: python-user-site | ||
| uses: actions/cache@v5.0.5 | ||
| with: | ||
| path: ~/.local | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('.devcontainer/requirements.txt') }} | ||
| - name: Install Python dependencies | ||
| run: | | ||
| if [ -f .devcontainer/requirements.txt ]; then | ||
| pip install -r .devcontainer/requirements.txt | ||
| elif [ -f requirements.txt ]; then | ||
| pip install -r requirements.txt | ||
| fi | ||
| - name: Ensure local bin on PATH | ||
| run: echo "$HOME/.local/bin" >> "$GITHUB_PATH" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk):
actions/*versions here are also pinned to non-existent majors.These
actions/*versions (e.g.actions/checkout@v6,actions/setup-python@v6.2.0, possiblyactions/cache@v5.0.5) do not exist and will cause the workflow to fail. Please update them to currently published majors (for exampleactions/checkout@v4,actions/setup-python@v5,actions/cache@v4) and optionally add tighter pinning if deterministic behavior is required.