Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-treebeard committed Feb 20, 2024
1 parent b9d6ee0 commit 7b2fcb8
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile
ARG VARIANT="3.11"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} as devcontainer
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
USER vscode
RUN pip3 --disable-pip-version-check --no-cache-dir install -U \
'poetry==1.6.1' \
'pre-commit==3.6.0' \
'pip==23.2.1'
RUN npm install -g @devcontainers/[email protected]
ENV DEBIAN_FRONTEND=noninteractive
RUN sudo apt-get update -y && sudo apt-get install -y \
iputils-ping \
traceroute \
kmod
ENV PATH="/workspaces/shadowfax/bin:/home/vscode/.local/bin/:$PATH"
88 changes: 88 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"postCreateCommand": "make post-create",
"postStartCommand": "make post-start",
"remoteUser": "vscode",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"python.pythonPath": "/usr/local/bin/python"
},
"extensions": [
"ms-python.python",
"mutantdino.resourcemonitor",
"github.copilot",
"github.copilot-chat"
]
}
},
"build": {
"dockerfile": "Dockerfile",
"target": "devcontainer",
"context": "..",
"args": {
"VARIANT": "3.11",
"INSTALL_NODE": "true",
"NODE_VERSION": "18.7"
}
},
"runArgs": [ // maybe remove this
"--network=host",
],
"features": {
"ghcr.io/devcontainers-contrib/features/cloudflared:1": {},
"ghcr.io/devcontainers/features/go:1": {
},
"ghcr.io/devcontainers/features/aws-cli": {
"version": "2.6.3"
},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"omzPlugins": "zsh-syntax-highlighting zsh-autosuggestions"
},
"ghcr.io/devcontainers-contrib/features/starship-homebrew:1": {},
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
"version": "2.59.0"
},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/terraform:1": {
"version": "1.6.2"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers-contrib/features/kind:1": {},
"ghcr.io/devcontainers-contrib/features/packer-asdf:2": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "1.25.6"
},
"ghcr.io/rio/features/k3d:1": {},
// "ghcr.io/devcontainers/features/nix:1": {},
"ghcr.io/devcontainers-contrib/features/infracost:1": {
"version": "0.10.30"
},
"ghcr.io/dhoeric/features/google-cloud-cli:1": {
},
"ghcr.io/devcontainers-contrib/features/terraform-docs:1": {
},
"ghcr.io/devcontainers/features/github-cli:1": {
},
"ghcr.io/rio/features/k9s:1": {
},
"ghcr.io/devcontainers-contrib/features/vercel-cli:1": {
},
},
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
// "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zsh_history,target=/home/vscode/.zsh_history,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshrc,target=/home/vscode/.zshrc,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.zshenv,target=/home/vscode/.zshenv,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.terraform.d,target=/home/vscode/.terraform.d,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/infracost,target=/home/vscode/.config/infracost,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/gcloud,target=/home/vscode/.config/gcloud,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.config/starship.toml,target=/home/vscode/.config/starship.toml,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.kube,target=/home/vscode/.kube,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
]
}
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SHELLOPTS := $(if $(SHELLOPTS),$(SHELLOPTS):, )xtrace pipefail errexit nounset

.PHONY: post-create
post-create:
@echo "post-create"

.PHONY: post-start
post-start:
@echo "post-start"
./scripts/setup-krew.sh

docs:
terraform-docs markdown ./modules/treebeardkf > ./modules/treebeardkf/README.md
go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest
helm-docs

fmt:
terraform fmt **/*modules
.PHONY: build
Empty file added main.tf
Empty file.
Empty file added outputs.tf
Empty file.
10 changes: 10 additions & 0 deletions scripts/setup-krew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export KREW_ROOT=/workspaces/shadowfax
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew

bash -c 'kubectl krew install resource-capacity'
Empty file added variables.tf
Empty file.

0 comments on commit 7b2fcb8

Please sign in to comment.