Skip to content

Commit 5eebd3a

Browse files
authored
Copier update (SSM Port Forwarding) (#17)
Pull in updates from base template
1 parent 4453106 commit 5eebd3a

14 files changed

+82
-10
lines changed

.copier-answers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.0.16
2+
_commit: v0.0.19
33
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
44
description: Copier template for creating Python libraries and executables
55
python_ci_versions:
@@ -9,6 +9,7 @@ python_version: 3.12.7
99
repo_name: copier-python-package-template
1010
repo_org_name: LabAutomationAndScreening
1111
ssh_port_number: 55874
12+
template_might_want_to_install_aws_ssm_port_forwarding_plugin: false
1213
template_uses_javascript: false
1314
template_uses_pulumi: false
1415
template_uses_python: true

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.8'
21
services:
32
devcontainer:
43
build:

.devcontainer/install-ci-tooling.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -ex
44

55

66

7+
8+
79
curl -LsSf https://astral.sh/uv/0.6.6/install.sh | sh
810
uv --version
911
# TODO: add uv autocompletion to the shell https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build Docker Image
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
repository:
7+
description: 'Docker repository'
8+
type: string
9+
required: true
10+
image_name:
11+
description: 'Docker image name'
12+
type: string
13+
required: true
14+
tag:
15+
description: 'Docker image tag'
16+
type: string
17+
required: true
18+
context:
19+
description: 'Build context path'
20+
type: string
21+
required: false
22+
default: './'
23+
24+
25+
jobs:
26+
build-image:
27+
name: Build Docker Image
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- name: Checkout code
31+
uses: actions/[email protected]
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/[email protected]
35+
with:
36+
version: v0.22.0
37+
38+
- name: Build Docker Image
39+
uses: docker/[email protected]
40+
with:
41+
context: ${{ inputs.context }}
42+
push: false
43+
load: true # make the image available later for the `docker save` step
44+
tags: ${{ inputs.repository }}/${{ inputs.image_name }}:${{ inputs.tag }}
45+
46+
- name: Save Docker Image as tar
47+
run: docker save -o ${{ inputs.image_name }}.tar ${{ inputs.repository }}/${{ inputs.image_name }}:${{ inputs.tag }}
48+
49+
- name: Upload Docker Image Artifact
50+
uses: actions/[email protected]
51+
with:
52+
name: ${{ inputs.image_name }}
53+
path: ${{ inputs.image_name }}.tar
54+
if-no-files-found: error

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ repos:
175175
hooks:
176176
- id: hadolint-docker
177177
name: Lint Dockerfiles
178+
exclude: .*\.jinja$
178179
description: Runs hadolint to lint Dockerfiles
179180

180181
- repo: https://github.com/astral-sh/ruff-pre-commit
181-
rev: 99abe27a5a16f301d9e0a3828181399dfbf54ebd # frozen: v0.11.0
182+
rev: 25a8c8da6c24a3b9a1a536e2674683dd0eead5d6 # frozen: v0.11.2
182183
hooks:
183184
- id: ruff
184185
name: ruff-src
@@ -191,7 +192,7 @@ repos:
191192
- id: ruff-format
192193

193194
- repo: https://github.com/pylint-dev/pylint
194-
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
195+
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
195196
hooks:
196197
- id: pylint
197198
name: pylint

extensions/context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
3434
context["fastapi_version"] = "0.115.11"
3535
context["uvicorn_version"] = "0.34.0"
3636

37+
context["nuxt_ui_version"] = "^3.0.0"
38+
context["nuxt_version"] = "^3.16.0"
39+
context["typescript_version"] = "^5.8.2"
40+
3741
context["gha_checkout"] = "v4.2.2"
3842
context["gha_setup_python"] = "v5.4.0"
3943
context["gha_cache"] = "v4.2.2"
4044
context["gha_upload_artifact"] = "v4.6.2"
4145
context["gha_download_artifact"] = "v4.2.1"
4246
context["gha_setup_buildx"] = "v3.10.0"
47+
context["buildx_version"] = "v0.22.0"
4348
context["gha_docker_build_push"] = "v6.15.0"
4449
context["gha_configure_aws_credentials"] = "v4.1.0"
4550
context["gha_setup_node"] = "v4.3.0"

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22
# Settings managed by the base template
33
norecursedirs = node_modules .precommit_cache .npm_cache .pipenv_cache venv .venv .history
4-
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered
4+
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=./.coveragerc
55

66
log_cli = 1
77
log_cli_level = INFO

template/.devcontainer/devcontainer.json.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
{% endraw %}{% if is_child_of_copier_base_template is not defined and template_uses_vuejs is defined and template_uses_vuejs is sameas(true) %}{% raw %}
4242
// VueJS
4343
44+
4445
{% endraw %}{% endif %}{% raw %}{% endraw %}{% if is_child_of_copier_base_template is not defined and template_uses_javascript is defined and template_uses_javascript is sameas(true) %}{% raw %}
4546
// All javascript
4647

template/.devcontainer/docker-compose.yml.jinja

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{% raw %}version: '3.8'
2-
services:
1+
{% raw %}services:
32
devcontainer:
43
build:
54
context: .

template/.devcontainer/install-ci-tooling.sh.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
# can pass in the full major.minor.patch version of python as an optional argument
33
set -ex
44

5+
{% endraw %}{% if is_child_of_copier_base_template is not defined and install_aws_ssm_port_forwarding_plugin is defined and install_aws_ssm_port_forwarding_plugin is sameas(true) %}{% raw %}
6+
# Based on https://docs.aws.amazon.com/systems-manager/latest/userguide/install-plugin-debian-and-ubuntu.html
7+
# TODO: figure out how to pin this
8+
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "/tmp/session-manager-plugin.deb"
9+
sudo dpkg -i /tmp/session-manager-plugin.deb
10+
session-manager-plugin --version{% endraw %}{% endif %}{% raw %}
11+
512
{% endraw %}{% if template_uses_javascript is defined and template_uses_javascript is sameas(true) %}{% raw %}
613
npm -v
714
npm install -g pnpm@{% endraw %}{{ pnpm_version }}{% raw %}

template/.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ repos:
175175
hooks:
176176
- id: hadolint-docker
177177
name: Lint Dockerfiles
178+
exclude: .*\.jinja$
178179
description: Runs hadolint to lint Dockerfiles
179180

180181
- repo: https://github.com/astral-sh/ruff-pre-commit
181-
rev: 99abe27a5a16f301d9e0a3828181399dfbf54ebd # frozen: v0.11.0
182+
rev: 25a8c8da6c24a3b9a1a536e2674683dd0eead5d6 # frozen: v0.11.2
182183
hooks:
183184
- id: ruff
184185
name: ruff-src
@@ -191,7 +192,7 @@ repos:
191192
- id: ruff-format
192193

193194
- repo: https://github.com/pylint-dev/pylint
194-
rev: 88543500c70e3aa303b6c0861e2a7a006673f6a8
195+
rev: 7ac5a4d4f77576df3a00e63f86ca86e0e1780b47 # frozen: v3.3.6
195196
hooks:
196197
- id: pylint
197198
name: pylint

template/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[pytest]
22
# Settings managed by the base template
33
norecursedirs = node_modules .precommit_cache .npm_cache .pipenv_cache venv .venv .history
4-
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered
4+
addopts = --cov=src --cov-report html --cov-report term-missing:skip-covered --cov-config=./.coveragerc
55

66
log_cli = 1
77
log_cli_level = INFO

tests/copier_data/data1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ssh_port_number: 12345
77
use_windows_in_ci: false
88

99

10+
1011
python_package_registry: PyPI
1112
aws_identity_center_id: d-9145c20053
1213
aws_org_home_region: us-west-2

tests/copier_data/data2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ssh_port_number: 54321
77
use_windows_in_ci: true
88

99

10+
1011
python_package_registry: AWS CodeArtifact
1112
aws_central_infrastructure_account_id: 012321432543
1213
core_infra_base_access_profile_name: MyAccessRole

0 commit comments

Comments
 (0)