Skip to content

Commit

Permalink
Ndcum 1315 (#6)
Browse files Browse the repository at this point in the history
* Adding Python 3.10 dockerfiles

* Updating github check action versions

* Updating docker stuff

* Trying to figure out permissions issue

* more permissions

* Reverting

* Reverting action versions

* Update build.sh

* Added additional logging when a requirements file is generated

* Adding poetry-plugin-export

* Making sure to CD to proper directory

* Troubleshooting why requirements are not being added

* Removing unneeded install

* More debugging

* More debugging

* Updating dockerfile

* Removing command that didn't work

* Adding more debugging notes

* Removing debugging stuff

* Updating action versions

---------

Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Mike Dorfman <[email protected]>
Co-authored-by: mikedorfman <[email protected]>
  • Loading branch information
4 people authored Sep 4, 2024
1 parent 35fe16d commit cfd5528
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.aws-sam-cli-build-image-python3.10
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM linuxbrew/brew:latest
FROM homebrew/brew:latest

RUN brew install groff
RUN brew install libyaml
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.aws-sam-cli-build-image-python3.9
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM linuxbrew/brew:latest
FROM homebrew/brew:latest

RUN brew install groff
RUN brew install libyaml
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.py310
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM nsidc/aws-sam-cli-build-image-python3.10:latest

RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH "$PATH:/root/.local/bin"
RUN curl -sSL https://install.python-poetry.org | python3.10 -
ENV PATH "$PATH:/root/.local/bin:/home/linuxbrew/.local/bin"

COPY sam_build.sh /sam_build.sh

Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ docker build -t ${DOCKER_IMAGE_TAG} "${BUILDER_DIR}" -f "${DOCKERFILE}"

# run the build script on the docker container
docker run \
--user root \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "${PROJECT_DIR}":"${PROJECT_DIR}" \
-e PROJECT_DIR="${PROJECT_DIR}" \
Expand Down
4 changes: 3 additions & 1 deletion sam_build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -ex

# run this on the docker container; works on host too if environment variables
# set and sam is installed
Expand Down Expand Up @@ -31,7 +31,9 @@ export SAM_CLI_TELEMETRY=0

REQUIREMENTS_FILE="${PROJECT_DIR}/src/requirements.txt"
if [ ! -f "${REQUIREMENTS_FILE}" ]; then
echo "No requirements file found, generating one..."
cd "${PROJECT_DIR}"
poetry self add poetry-plugin-export
poetry export -f requirements.txt --output "${REQUIREMENTS_FILE}"
cd -
fi
Expand Down

0 comments on commit cfd5528

Please sign in to comment.