Skip to content

Chore: add AWS dev tools #109

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 1 commit into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,29 @@ RUN pip install --no-cache-dir -r docs/requirements.txt

# install streamlit requirements
RUN pip install --no-cache-dir -r streamlit_app/requirements.txt

# install AWS CLI and Copilot CLI (requires root permissions)
USER root
# download AWS CLIs to /tmp to avoid write error (23) from curl command
WORKDIR /tmp
RUN HOST_ARCH=$(uname -m) && \
case "$HOST_ARCH" in \
x86_64) HOST_ARCH="amd64" ;; \
aarch64) HOST_ARCH="arm64" ;; \
esac \
&& if [ "$HOST_ARCH" = "amd64" ]; then \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \
elif [ "$HOST_ARCH" = "arm64" ]; then \
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \
fi \
&& unzip awscliv2.zip \
&& ./aws/install \
&& rm -rf aws awscliv2.zip

RUN curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux \
&& chmod +x copilot \
&& mv copilot /usr/local/bin/copilot

# Switch back to non-root user and app directory
USER $USER
WORKDIR /$USER/app
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ DJANGO_DB_FIXTURES="pems/local_fixtures.json"
STREAMLIT_LOCAL_PORT=8501
# options: hidden, sidebar
STREAMLIT_NAV=hidden

# AWS
AWS_PROFILE=pems
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
entrypoint: sleep infinity
volumes:
- ./:/caltrans/app
- ${HOME}/.aws:/home/caltrans/.aws

docs:
image: caltrans/pems:dev
Expand Down
Loading