-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add initial vscode devcontainer files (#6736)
- Loading branch information
1 parent
80f83cf
commit 22eeec6
Showing
6 changed files
with
133 additions
and
0 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,7 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
} | ||
] | ||
} |
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,11 @@ | ||
### Steps for using a devcontainer (without Kubernetes) | ||
|
||
0. Launch a cluster with the `det deploy` command. | ||
1. Ensure that VSCode dev extensions are installed. | ||
2. SSH to server instance and setup VSCode with remote SSH server. | ||
3. Resize disk space on remote server if needed. | ||
4. Setup github credentials and clone repository. | ||
5. Stop the deployed server instance. | ||
6. Open workspace file with VSCode connected to remote SSH server. | ||
7. Use VSCode to build and launch devcontainer. | ||
8. After remote server launches localhost:8080 should be available. |
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,66 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/go | ||
{ | ||
"name": "determined-backend-dev-go", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/go:0-1.20", | ||
"features": { | ||
"ghcr.io/guiyomh/features/golangci-lint:0": {}, | ||
"ghcr.io/devcontainers/features/python:1": {}, | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"nodeGypDependencies": true, | ||
"version": "19.7.0" | ||
} | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ 8080 ], | ||
"appPort": [ 8080 ], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "go version", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
"mounts": [ | ||
{ | ||
"type": "bind", | ||
"source": "/usr/local/determined/etc", | ||
"target": "/etc/determined" | ||
}, | ||
{ | ||
"type": "volume", | ||
"source": "dev-home", | ||
"target": "/home" | ||
}, | ||
{ | ||
"type": "volume", | ||
"source": "dev-go", | ||
"target": "/go" | ||
}, | ||
{ | ||
"type": "volume", | ||
"source": "dev-usr", | ||
"target": "/usr" | ||
}, | ||
{ | ||
"type": "volume", | ||
"source": "dev-var", | ||
"target": "/var" | ||
} | ||
], | ||
|
||
"runArgs": [ | ||
"--network=host" | ||
], | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root", | ||
"privileged": true, | ||
|
||
"postStartCommand": ".devcontainer/start.sh" | ||
} |
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,9 @@ | ||
#!/usr/bin/env bash | ||
set -xeuo pipefail | ||
|
||
VERSION=$(cat VERSION) | ||
GO_LDFLAGS="-X github.com/determined-ai/determined/master/version.Version=${VERSION}" | ||
|
||
nodemon --watch './**/*' -e go --signal SIGTERM --exec \ | ||
go run -ldflags "${GO_LDFLAGS}" \ | ||
./master/cmd/determined-master -- --log-level debug 2>&1 |
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,27 @@ | ||
#!/usr/bin/env bash | ||
set -xeuo pipefail | ||
|
||
if [ -z "$(command -v helm)" ]; then | ||
curl -L https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
fi | ||
if [ -z "$(command -v protoc)" ]; then | ||
curl --retry-connrefused --retry 10 -o /tmp/protoc.zip -L https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protoc-3.20.3-linux-x86_64.zip | ||
sudo unzip -o /tmp/protoc.zip -d /usr/local | ||
fi | ||
if [ -z "$(command -v nodemon)" ]; then | ||
npm i -g nodemon | ||
fi | ||
|
||
make get-deps | ||
|
||
make -C proto build | ||
make -C harness build | ||
make -C webui build | ||
make -C docs build | ||
make -C agent build | ||
|
||
make -C tools prep-root | ||
sudo mkdir -p /usr/share/determined | ||
sudo ln -sfT ${PWD}/tools/build /usr/share/determined/master | ||
|
||
sudo chmod a+w /var/cache |
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,13 @@ | ||
#!/usr/bin/env bash | ||
set -xeuo pipefail | ||
|
||
STAMP=${HOME}/.determined-setup.stamp | ||
if [ ! -f ${STAMP} ]; then | ||
.devcontainer/setup.sh | ||
touch ${STAMP} | ||
fi | ||
|
||
LOG=${HOME}/determined-server.log | ||
touch ${LOG} | ||
nohup .devcontainer/server.sh >>${LOG} & | ||
tail -f ${LOG} |