Skip to content

Commit

Permalink
chore: dev containers (#969)
Browse files Browse the repository at this point in the history
* chore: dev containers

* fix: review comments
  • Loading branch information
surbhigarg92 committed Jul 25, 2023
1 parent 35c7a36 commit a8fb395
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,16 @@
ARG VARIANT="3.8"
FROM mcr.microsoft.com/devcontainers/python:${VARIANT}

#install nox
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --upgrade --quiet --require-hashes -r requirements.txt

# install gh
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install gh -y

# install gloud sdk
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"args": { "VARIANT": "3.8" },
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "Dockerfile"
},

"postCreateCommand": "bash .devcontainer/postCreate.sh"
}
3 changes: 3 additions & 0 deletions .devcontainer/postCreate.sh
@@ -0,0 +1,3 @@
echo "Post Create Starting"

nox -s unit-3.8
1 change: 1 addition & 0 deletions .devcontainer/requirements.in
@@ -0,0 +1 @@
nox>=2022.11.21
38 changes: 38 additions & 0 deletions .devcontainer/requirements.txt
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --generate-hashes requirements.in
#
argcomplete==3.1.1 \
--hash=sha256:35fa893a88deea85ea7b20d241100e64516d6af6d7b0ae2bed1d263d26f70948 \
--hash=sha256:6c4c563f14f01440aaffa3eae13441c5db2357b5eec639abe7c0b15334627dff
# via nox
colorlog==6.7.0 \
--hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \
--hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5
# via nox
distlib==0.3.7 \
--hash=sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057 \
--hash=sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8
# via virtualenv
filelock==3.12.2 \
--hash=sha256:002740518d8aa59a26b0c76e10fb8c6e15eae825d34b6fdf670333fd7b938d81 \
--hash=sha256:cbb791cdea2a72f23da6ac5b5269ab0a0d161e9ef0100e653b69049a7706d1ec
# via virtualenv
nox==2023.4.22 \
--hash=sha256:0b1adc619c58ab4fa57d6ab2e7823fe47a32e70202f287d78474adcc7bda1891 \
--hash=sha256:46c0560b0dc609d7d967dc99e22cb463d3c4caf54a5fda735d6c11b5177e3a9f
# via -r requirements.in
packaging==23.1 \
--hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \
--hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f
# via nox
platformdirs==3.9.1 \
--hash=sha256:1b42b450ad933e981d56e59f1b97495428c9bd60698baab9f3eb3d00d5822421 \
--hash=sha256:ad8291ae0ae5072f66c16945166cb11c63394c7a3ad1b1bc9828ca3162da8c2f
# via virtualenv
virtualenv==20.24.1 \
--hash=sha256:01aacf8decd346cf9a865ae85c0cdc7f64c8caa07ff0d8b1dfc1733d10677442 \
--hash=sha256:2ef6a237c31629da6442b0bcaa3999748108c7166318d1f55cc9f8d7294e97bd
# via nox

0 comments on commit a8fb395

Please sign in to comment.