Skip to content
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN sudo python -m pip install --upgrade pip poetry && \
sudo poetry config virtualenvs.create false && \
sudo poetry install

ENV PORT 8080
ENV PORT=8080
EXPOSE $PORT

# Enable color terminal for docker exec bash
Expand Down
10 changes: 5 additions & 5 deletions .devcontainer/scripts/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sudo sh -c 'echo "127.0.0.1 cluster-registry" >> /etc/hosts'
echo "**********************************************************************"
echo "Installing K9s..."
echo "**********************************************************************"
curl -L -o k9s.tar.gz "https://github.com/derailed/k9s/releases/download/v0.32.4/k9s_Linux_$ARCH.tar.gz"
curl -L -o k9s.tar.gz "https://github.com/derailed/k9s/releases/download/v0.32.6/k9s_Linux_$ARCH.tar.gz"
tar xvzf k9s.tar.gz
sudo install -c -m 0755 k9s /usr/local/bin
rm k9s.tar.gz
Expand All @@ -44,25 +44,25 @@ sudo install -c -m 0755 devspace /usr/local/bin
echo "**********************************************************************"
echo "Installing Stern..."
echo "**********************************************************************"
curl -L -o stern.tar.gz "https://github.com/stern/stern/releases/download/v1.28.0/stern_1.28.0_linux_$ARCH.tar.gz"
curl -L -o stern.tar.gz "https://github.com/stern/stern/releases/download/v1.31.0/stern_1.31.0_linux_$ARCH.tar.gz"
tar xvzf stern.tar.gz
sudo install -c -m 0755 stern /usr/local/bin
rm stern.tar.gz LICENSE

echo "**********************************************************************"
echo "Installing Knative CLI..."
echo "**********************************************************************"
curl -L -o kn "https://github.com/knative/client/releases/download/knative-v1.14.0/kn-linux-$ARCH"
curl -L -o kn "https://github.com/knative/client/releases/download/knative-v1.16.0/kn-linux-$ARCH"
sudo install -c -m 0755 kn /usr/local/bin
rm kn

echo "**********************************************************************"
echo "Installing Tekton CLI..."
echo "**********************************************************************"
if [ $ARCH == amd64 ]; then
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
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
else
curl -L https://github.com/tektoncd/cli/releases/download/v0.36.0/tkn_0.36.0_Linux_aarch64.tar.gz --output tekton.tar.gz
curl -L https://github.com/tektoncd/cli/releases/download/v0.38.1/tkn_0.38.1_Linux_aarch64.tar.gz --output tekton.tar.gz
fi;
tar xvzf tekton.tar.gz tkn
sudo install -c -m 0755 tkn /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/scripts/setup-lab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "Pulling custom Python:3.11-slim image from quay.io..."
docker pull quay.io/rofrano/python:3.11-slim
# docker run -d --name postgresql --restart always -p 5432:5432 -v postgres:/var/lib/postgresql/data postgres:alpine

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

echo "Making git stop complaining about unsafe folders"
Expand Down
16 changes: 8 additions & 8 deletions .tekton/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ spec:

echo "***** Installing dependencies *****"
if [ -e "poetry.lock" ]; then
echo "Found poetry.lock file: using poetry "
python -m pip install poetry poetry-plugin-export
poetry export --with=dev -f requirements.txt --output requirements.txt
python -m pip install --user -r requirements.txt
echo "Found poetry.lock file: using poetry ..."
python -m pip install --upgrade pip poetry
poetry config virtualenvs.create false
poetry install
elif [ -n "$(params.requirements-file)" ] && [ -e "$(params.requirements-file)" ]; then
python -m pip install --user -r "$(params.requirements-file)"
fi
Expand Down Expand Up @@ -114,10 +114,10 @@ spec:

echo "***** Installing dependencies *****"
if [ -e "poetry.lock" ]; then
echo "Found poetry.lock file: using poetry "
python -m pip install poetry poetry-plugin-export
poetry export --with=dev -f requirements.txt --output requirements.txt
python -m pip install --user -r requirements.txt
echo "Found poetry.lock file: using poetry ..."
python -m pip install --upgrade pip poetry
poetry config virtualenvs.create false
poetry install
elif -e "requirements.txt" ]; then
python -m pip install --user -r requirements.txt
fi
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ USER flask

# Expose any ports the app is expecting in the environment
ENV FLASK_APP=wsgi:app
ENV PORT 8080
ENV PORT=8080
EXPOSE $PORT

ENV GUNICORN_BIND 0.0.0.0:$PORT
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These can be overidden with env vars.
REGISTRY ?= cluster-registry:32000
REGISTRY ?= cluster-registry:5000
IMAGE_NAME ?= petshop
IMAGE_TAG ?= 1.0
IMAGE ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
Expand Down Expand Up @@ -61,8 +61,8 @@ secret: ## Generate a secret hex key

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

.PHONY: cluster-rm
cluster-rm: ## Remove a K3D Kubernetes cluster
Expand Down
Loading
Loading