Skip to content

Commit 671518f

Browse files
authored
Merge pull request #7 from nyu-devops/fa24-updates
Fa24 updates
2 parents 37e8360 + 1eeb514 commit 671518f

File tree

8 files changed

+682
-1469
lines changed

8 files changed

+682
-1469
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN sudo python -m pip install --upgrade pip poetry && \
2727
sudo poetry config virtualenvs.create false && \
2828
sudo poetry install
2929

30-
ENV PORT 8080
30+
ENV PORT=8080
3131
EXPOSE $PORT
3232

3333
# Enable color terminal for docker exec bash

.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.4/k9s_Linux_$ARCH.tar.gz"
27+
curl -L -o k9s.tar.gz "https://github.com/derailed/k9s/releases/download/v0.32.6/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.28.0/stern_1.28.0_linux_$ARCH.tar.gz"
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"
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.14.0/kn-linux-$ARCH"
55+
curl -L -o kn "https://github.com/knative/client/releases/download/knative-v1.16.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.36.0/tkn_0.36.0_Linux_x86_64.tar.gz --output tekton.tar.gz
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
6464
else
65-
curl -L https://github.com/tektoncd/cli/releases/download/v0.36.0/tkn_0.36.0_Linux_aarch64.tar.gz --output tekton.tar.gz
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
6666
fi;
6767
tar xvzf tekton.tar.gz tkn
6868
sudo install -c -m 0755 tkn /usr/local/bin

.devcontainer/scripts/setup-lab.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ echo "Pulling custom Python:3.11-slim image from quay.io..."
77
docker pull quay.io/rofrano/python:3.11-slim
88
# docker run -d --name postgresql --restart always -p 5432:5432 -v postgres:/var/lib/postgresql/data postgres:alpine
99

10-
echo Setting up registry.local...
10+
echo "Setting up registry.local..."
1111
sudo bash -c "echo '127.0.0.1 cluster-registry' >> /etc/hosts"
1212

1313
echo "Making git stop complaining about unsafe folders"

.tekton/tasks.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ spec:
4545
4646
echo "***** Installing dependencies *****"
4747
if [ -e "poetry.lock" ]; then
48-
echo "Found poetry.lock file: using poetry "
49-
python -m pip install poetry poetry-plugin-export
50-
poetry export --with=dev -f requirements.txt --output requirements.txt
51-
python -m pip install --user -r requirements.txt
48+
echo "Found poetry.lock file: using poetry ..."
49+
python -m pip install --upgrade pip poetry
50+
poetry config virtualenvs.create false
51+
poetry install
5252
elif [ -n "$(params.requirements-file)" ] && [ -e "$(params.requirements-file)" ]; then
5353
python -m pip install --user -r "$(params.requirements-file)"
5454
fi
@@ -114,10 +114,10 @@ spec:
114114
115115
echo "***** Installing dependencies *****"
116116
if [ -e "poetry.lock" ]; then
117-
echo "Found poetry.lock file: using poetry "
118-
python -m pip install poetry poetry-plugin-export
119-
poetry export --with=dev -f requirements.txt --output requirements.txt
120-
python -m pip install --user -r requirements.txt
117+
echo "Found poetry.lock file: using poetry ..."
118+
python -m pip install --upgrade pip poetry
119+
poetry config virtualenvs.create false
120+
poetry install
121121
elif -e "requirements.txt" ]; then
122122
python -m pip install --user -r requirements.txt
123123
fi

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ USER flask
2121

2222
# Expose any ports the app is expecting in the environment
2323
ENV FLASK_APP=wsgi:app
24-
ENV PORT 8080
24+
ENV PORT=8080
2525
EXPOSE $PORT
2626

2727
ENV GUNICORN_BIND 0.0.0.0:$PORT

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# These can be overidden with env vars.
2-
REGISTRY ?= cluster-registry:32000
2+
REGISTRY ?= cluster-registry:5000
33
IMAGE_NAME ?= petshop
44
IMAGE_TAG ?= 1.0
55
IMAGE ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
@@ -61,8 +61,8 @@ secret: ## Generate a secret hex key
6161

6262
.PHONY: cluster
6363
cluster: ## Create a K3D Kubernetes cluster with load balancer and registry
64-
$(info Creating Kubernetes cluster with a registry and 2 worker nodes...)
65-
k3d cluster create nyu-devops --agents 2 --registry-create cluster-registry:0.0.0.0:5000 --port '8080:80@loadbalancer'
64+
$(info Creating Kubernetes cluster $(CLUSTER) with a registry and 2 worker nodes...)
65+
k3d cluster create $(CLUSTER) --agents 2 --registry-create cluster-registry:0.0.0.0:5000 --port '8080:80@loadbalancer'
6666

6767
.PHONY: cluster-rm
6868
cluster-rm: ## Remove a K3D Kubernetes cluster

0 commit comments

Comments
 (0)