Skip to content

Commit a59f5b4

Browse files
authored
Merge pull request #8 from nyu-devops/sp25-updates
Removed poetry and added pipenv
2 parents 671518f + e0aca10 commit a59f5b4

File tree

11 files changed

+1134
-1555
lines changed

11 files changed

+1134
-1555
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Image for a Python 3 development environment
2-
FROM python:3.11-slim
2+
FROM quay.io/rofrano/python:3.11-slim
33

44
# Add any tools that are needed beyond Python 3.11
55
RUN apt-get update && \
@@ -12,7 +12,7 @@ ARG USERNAME=vscode
1212
ARG USER_UID=1000
1313
ARG USER_GID=$USER_UID
1414

15-
# Create the user with passwordless sudo privileges
15+
# Create the user with password-less sudo privileges
1616
RUN groupadd --gid $USER_GID $USERNAME \
1717
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
1818
&& usermod -aG sudo $USERNAME \
@@ -22,10 +22,9 @@ RUN groupadd --gid $USER_GID $USERNAME \
2222

2323
# Set up the Python development environment
2424
WORKDIR /app
25-
COPY pyproject.toml poetry.lock ./
26-
RUN sudo python -m pip install --upgrade pip poetry && \
27-
sudo poetry config virtualenvs.create false && \
28-
sudo poetry install
25+
COPY Pipfile Pipfile.lock ./
26+
RUN python -m pip install --upgrade pip pipenv && \
27+
pipenv install --system --dev
2928

3029
ENV PORT=8080
3130
EXPOSE $PORT

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"sqlalchemy",
1313
"psycopg",
1414
"pytest",
15+
"pipenv",
1516
"tekton",
1617
"creds",
1718
"virtualenvs"
@@ -57,9 +58,7 @@
5758
"hbenl.vscode-test-explorer",
5859
"LittleFoxTeam.vscode-python-test-adapter",
5960
"redhat.vscode-yaml",
60-
"rangav.vscode-thunder-client",
6161
"ms-azuretools.vscode-docker",
62-
"redhat.fabric8-analytics",
6362
"inercia.vscode-k3d",
6463
"ms-kubernetes-tools.vscode-kubernetes-tools",
6564
"redhat.vscode-openshift-connector",

.devcontainer/scripts/install-tools.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sudo sh -c 'echo "127.0.0.1 cluster-registry" >> /etc/hosts'
2424
echo "**********************************************************************"
2525
echo "Installing K9s..."
2626
echo "**********************************************************************"
27-
curl -L -o k9s.tar.gz "https://github.com/derailed/k9s/releases/download/v0.32.6/k9s_Linux_$ARCH.tar.gz"
27+
curl -L -o k9s.tar.gz "https://github.com/derailed/k9s/releases/download/v0.32.7/k9s_Linux_$ARCH.tar.gz"
2828
tar xvzf k9s.tar.gz
2929
sudo install -c -m 0755 k9s /usr/local/bin
3030
rm k9s.tar.gz
@@ -44,25 +44,25 @@ sudo install -c -m 0755 devspace /usr/local/bin
4444
echo "**********************************************************************"
4545
echo "Installing Stern..."
4646
echo "**********************************************************************"
47-
curl -L -o stern.tar.gz "https://github.com/stern/stern/releases/download/v1.31.0/stern_1.31.0_linux_$ARCH.tar.gz"
47+
curl -L -o stern.tar.gz "https://github.com/stern/stern/releases/download/v1.32.0/stern_1.32.0_linux_$ARCH.tar.gz"
4848
tar xvzf stern.tar.gz
4949
sudo install -c -m 0755 stern /usr/local/bin
5050
rm stern.tar.gz LICENSE
5151

5252
echo "**********************************************************************"
5353
echo "Installing Knative CLI..."
5454
echo "**********************************************************************"
55-
curl -L -o kn "https://github.com/knative/client/releases/download/knative-v1.16.0/kn-linux-$ARCH"
55+
curl -L -o kn "https://github.com/knative/client/releases/download/knative-v1.17.0/kn-linux-$ARCH"
5656
sudo install -c -m 0755 kn /usr/local/bin
5757
rm kn
5858

5959
echo "**********************************************************************"
6060
echo "Installing Tekton CLI..."
6161
echo "**********************************************************************"
6262
if [ $ARCH == amd64 ]; then
63-
curl -L https://github.com/tektoncd/cli/releases/download/v0.38.1/tkn_0.38.1_Linux_x86_64.tar.gz --output tekton.tar.gz
63+
curl -L https://github.com/tektoncd/cli/releases/download/v0.39.1/tkn_0.39.1_Linux_x86_64.tar.gz --output tekton.tar.gz
6464
else
65-
curl -L https://github.com/tektoncd/cli/releases/download/v0.38.1/tkn_0.38.1_Linux_aarch64.tar.gz --output tekton.tar.gz
65+
curl -L https://github.com/tektoncd/cli/releases/download/v0.39.1/tkn_0.39.1_Linux_aarch64.tar.gz --output tekton.tar.gz
6666
fi;
6767
tar xvzf tekton.tar.gz tkn
6868
sudo install -c -m 0755 tkn /usr/local/bin

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ jobs:
4444

4545
- name: Install dependencies
4646
run: |
47-
python -m pip install -U pip poetry
48-
poetry config virtualenvs.create false
49-
poetry install
47+
python -m pip install -U pip pipenv
48+
pipenv install --system --dev
5049
5150
- name: Linting
5251
run: |

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
##################################################
44
FROM quay.io/rofrano/python:3.11-slim
55

6-
# Create working folder and install dependencies without dev
6+
# Set up the Python production environment
77
WORKDIR /app
8-
COPY pyproject.toml poetry.lock ./
9-
RUN python -m pip install --upgrade pip poetry && \
10-
poetry config virtualenvs.create false && \
11-
poetry install --no-root --without dev
8+
COPY Pipfile Pipfile.lock ./
9+
RUN python -m pip install --upgrade pip pipenv && \
10+
pipenv install --system --deploy
1211

1312
# Copy the application contents
1413
COPY wsgi.py .
@@ -20,10 +19,10 @@ RUN useradd --uid 1001 flask && \
2019
USER flask
2120

2221
# Expose any ports the app is expecting in the environment
23-
ENV FLASK_APP=wsgi:app
22+
ENV FLASK_APP="wsgi:app"
2423
ENV PORT=8080
2524
EXPOSE $PORT
2625

27-
ENV GUNICORN_BIND 0.0.0.0:$PORT
26+
ENV GUNICORN_BIND=0.0.0.0:$PORT
2827
ENTRYPOINT ["gunicorn"]
2928
CMD ["--log-level=info", "wsgi:app"]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ knative: ## Install Knative
100100
# kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.12.0/eventing-core.yaml
101101

102102
.PHONY: deploy
103-
depoy: ## Deploy the service on local Kubernetes
103+
deploy: ## Deploy the service on local Kubernetes
104104
$(info Deploying service locally...)
105105
kubectl apply -f k8s/
106106

@@ -119,12 +119,12 @@ init: ## Creates the buildx instance
119119

120120
.PHONY: build
121121
build: ## Build the project container image for local platform
122-
$(info Building $(IMAGE) for $(PLATFORM)...)
122+
$(info Building $(IMAGE)...)
123123
docker build --rm --pull --tag $(IMAGE) .
124124

125125
.PHONY: push
126126
push: ## Push the image to the container registry
127-
$(info Pusing $(IMAGE) for $(PLATFORM)...)
127+
$(info Pushing $(IMAGE)...)
128128
docker push $(IMAGE)
129129

130130
.PHONY: buildx

Pipfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
flask = "~=3.1.0"
8+
flask-sqlalchemy = "~=3.1.1"
9+
psycopg = {extras = ["binary"], version = "~=3.2.4"}
10+
retry2 = "~=0.9.5"
11+
python-dotenv = "~=1.0.1"
12+
gunicorn = "~=23.0.0"
13+
14+
[dev-packages]
15+
black = "~=25.1.0"
16+
coverage = "~=7.6.10"
17+
flake8 = "~=7.1.1"
18+
pylint = "~=3.3.4"
19+
pytest = "~=8.3.4"
20+
pytest-pspec = "~=0.0.4"
21+
pytest-cov = "~=6.0.0"
22+
factory-boy = "~=3.3.1"
23+
honcho = "~=2.0.0"
24+
httpie = "~=3.2.4"
25+
26+
[requires]
27+
python_version = "3.11"

0 commit comments

Comments
 (0)