forked from thanos-io/thanos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dev container and add Codespaces docs (thanos-io#6232)
Signed-off-by: Samruddhi Khandale <[email protected]>
- Loading branch information
1 parent
dead391
commit 527e65d
Showing
7 changed files
with
103 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# For details, see https://github.com/devcontainers/images/tree/main/src/go | ||
FROM mcr.microsoft.com/devcontainers/go:0-1.20 | ||
|
||
RUN echo "Downloading prometheus..." \ | ||
&& curl -sSL -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/prometheus/prometheus/tags" -o /tmp/tags.json \ | ||
&& VERSION_LIST="$(jq -r '.[] | select(.name | contains("rc") | not) | .name | split("v") | .[1]' /tmp/tags.json | tr -d '"' | sort -rV)" \ | ||
&& PROMETHEUS_LATEST_VERSION="$(echo "${VERSION_LIST}" | head -n 1)" \ | ||
&& PROMETHEUS_FILE_NAME="prometheus-${PROMETHEUS_LATEST_VERSION}.linux-amd64" \ | ||
&& curl -fsSLO "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_LATEST_VERSION}/${PROMETHEUS_FILE_NAME}.tar.gz" \ | ||
&& tar -xzf "${PROMETHEUS_FILE_NAME}.tar.gz" \ | ||
&& rm "${PROMETHEUS_FILE_NAME}.tar.gz" \ | ||
&& mv ${PROMETHEUS_FILE_NAME}/prometheus /go/bin/ | ||
ENV GOPROXY "https://proxy.golang.org" | ||
COPY .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,68 @@ | ||
// For more details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "Codespaces for Thanos", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"go.toolsManagement.checkForUpdates": "local", | ||
"go.useLanguageServer": true, | ||
"go.gopath": "/go" | ||
} | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-azuretools.vscode-docker", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"davidanson.vscode-markdownlint", | ||
"timonwong.shellcheck", | ||
"docsmsft.docs-yaml", | ||
"Grafana.vscode-jsonnet", | ||
"codezombiech.gitignore", | ||
"golang.Go" | ||
] | ||
"name": "Codespaces for Thanos", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "Dockerfile" | ||
}, | ||
|
||
"workspaceFolder": "/go/src/github.com/thanos-io/thanos", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/thanos-io/thanos,type=bind,consistency=cached", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {} | ||
}, | ||
|
||
"onCreateCommand": "make build", | ||
"postAttachCommand": { | ||
"Run quickstart": "bash scripts/quickstart.sh" | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
1313, | ||
9090, | ||
9091, | ||
9092, | ||
10904, | ||
10914 | ||
], | ||
"portsAttributes": { | ||
"1313": { | ||
"label": "Website" | ||
}, | ||
"9090": { | ||
"label": "Prometheus Instance 1" | ||
}, | ||
"9091": { | ||
"label": "Prometheus Instance 2" | ||
}, | ||
"9092": { | ||
"label": "Prometheus Instance 3" | ||
}, | ||
"10904": { | ||
"label": "Thanos Query 1" | ||
}, | ||
"10914": { | ||
"label": "Thanos Query 2" | ||
} | ||
}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-azuretools.vscode-docker", | ||
"ms-kubernetes-tools.vscode-kubernetes-tools", | ||
"davidanson.vscode-markdownlint", | ||
"timonwong.shellcheck", | ||
"docsmsft.docs-yaml", | ||
"Grafana.vscode-jsonnet", | ||
"codezombiech.gitignore" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
👋 Welcome to "Thanos" in GitHub Codespaces! | ||
|
||
🛠️ Your environment is fully setup with all the required software. | ||
|
||
🚀 All the components of Thanos are spinning up with the "quickstart" script, navigate over to the "Ports" tab to access it. | ||
|
||
ℹ️ Note: Change the visibility of "Prometheus instances" to "public" so that the API endpoints can be updated. | ||
|
||
🔍 To explore VS Code to its fullest, search using the Command Palette (Cmd/Ctrl + Shift + P or F1). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters