-
Notifications
You must be signed in to change notification settings - Fork 82
Migrate to Devcontainers POC #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
8d1319f
fb4c43f
e68310c
c021c4f
f0ace8e
83ddaac
71ce798
2e199ef
4f8ef2f
06a820b
339e6ce
f1181ca
9f037fe
c540440
6bfd9e5
7445f71
bcd7007
bd50bfe
903da9a
b0b0e6a
2524666
6eef356
42a606f
cb20752
abd0309
2f49dda
1d9cc22
0c52028
8b1a4f0
1e0da9b
664156a
add9aca
5429261
1fbacb8
4dc1b4e
42ea804
a64bbca
6bb7ab4
51efba9
120b448
e56a6f3
6f689ad
9bd1248
418379b
1b04e0c
be4cdc5
550b12d
7dd2e34
244e772
e866798
7479e22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Use the official Rust image as a base | ||
FROM mcr.microsoft.com/devcontainers/rust:bullseye | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
PKG_CONFIG_PATH='/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/share/pkgconfig' \ | ||
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \ | ||
CARGO_INCREMENTAL=0 \ | ||
SCCACHE_DIR=/home/vscode/.cache/sccache \ | ||
SCCACHE_CONF=/home/vscode/.config/sccache/config \ | ||
SCCACHE_DIRECT=true \ | ||
RUSTC_WRAPPER=sccache \ | ||
SCCACHE_CACHE_SIZE=5G | ||
|
||
# Enable Rust Bindings for Linux D-Bus interprocess communication(Required for Stellar CLI dependencies) | ||
RUN apt-get update && apt-get install -y \ | ||
libdbus-1-dev \ | ||
libudev-dev \ | ||
pkg-config \ | ||
dbus \ | ||
binaryen && apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /home/linuxbrew/ && \ | ||
chown -R vscode:vscode /home/linuxbrew/ | ||
|
||
USER vscode | ||
|
||
RUN HOMEBREW_BUNDLE_NO_UPGRADE=1 HOMEBREW_BUNDLE_INSTALL_CLEANUP=1 HOMEBREW_NO_INSTALL_UPGRADE=1 && \ | ||
HOMEBREW_NO_ANALYTICS=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_ENV_SYNC_STRICT=1 && \ | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \ | ||
/home/linuxbrew/.linuxbrew/bin/brew install sccache cargo-watch stellar-cli && \ | ||
/home/linuxbrew/.linuxbrew/bin/brew cleanup --scrub && rm -rf "$(brew --cache)" | ||
|
||
ENTRYPOINT exec "nohup /bin/bash -c make all&" | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"name": "Soroban Examples Dev Container(Debian Linux)", | ||
"dockerFile": "Dockerfile", | ||
"context": "..", | ||
"remoteUser": "vscode", | ||
"build": { | ||
"cacheFrom": [ | ||
"chrisstellar/vsc-soroban-examples-oci-prebuild", | ||
"chrisstellar/vsc-soroban-examples-95cce9-prebuild" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
"options": [ | ||
"--platform=linux/amd64" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
"args": { | ||
"DEBIAN_VERSION": "bullseye" | ||
} | ||
}, | ||
"hostRequirements": { | ||
"cpus": 4, | ||
"memory": "16", | ||
"storage": "32" | ||
}, | ||
"mounts": [ | ||
"type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/${remoteEnv:HOME}/.ssh,readonly" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
"forwardPorts": [ | ||
2222, | ||
4226 | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
], | ||
"portsAttributes": { | ||
"2222": { | ||
"onAutoForward": "notify", | ||
"label": "ssh", | ||
"requireLocalPort": true | ||
}, | ||
"4226": { | ||
"label": "sccache" | ||
} | ||
}, | ||
"remoteEnv": { | ||
"STELLAR_RPC_URL": "https://soroban-testnet.stellar.org", | ||
"STELLAR_NETWORK_PASSPHRASE": "Test SDF Network ; September 2015", | ||
"WORKSPACE": "${containerWorkspaceFolder}", | ||
"VSCODE_HOME": "/home/vscode" | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2.5.3": {}, | ||
"ghcr.io/devcontainers/features/rust:1.3.1": { | ||
"targets": "wasm32-unknown-unknown", | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"profile": "default", | ||
"version": "1.82" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": [ | ||
"README.md", | ||
"FULL_HELP_DOCS.md", | ||
"increment/src/lib.rs", | ||
"increment/src/test.rs" | ||
] | ||
}, | ||
"vscode": { | ||
"extensions": [ | ||
"rust-lang.rust-analyzer", | ||
"vadimcn.vscode-lldb", | ||
"tamasfe.even-better-toml" | ||
], | ||
"settings": { | ||
"workbench.settings.editor": "json", | ||
"npm.autoDetect": false, | ||
"telemetry.enableTelemetry": false, | ||
"rust-analyzer.check.command": "clippy", | ||
"terminal.integrated.allowChords": true, | ||
"terminal.integrated.copyOnSelection": true, | ||
"terminal.integrated.commandsToSkipShell": [ | ||
// Make copy+paste work without warning | ||
"-workbench.action.terminal.copySelection", | ||
"-workbench.action.terminal.paste", | ||
"-workbench.action.terminal.pasteSelection" | ||
] | ||
} | ||
}, | ||
}, | ||
"initializeCommand": "", | ||
"onCreateCommand": "", | ||
"updateContentCommand": "", | ||
"postCreateCommand": "", | ||
"postStartCommand": ".devcontainer/postStartCliAutocomplete.sh", | ||
"postAttachCommand": ".devcontainer/postAttachWelcomeText.sh", | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
clear | ||
|
||
echo "=========================================" | ||
echo " ✅ Getting Started with the Stellar CLI" | ||
echo "=========================================" | ||
echo "" | ||
echo " ⚙️ Environment variables:" | ||
echo " STELLAR_RPC_URL: ${STELLAR_RPC_URL}" | ||
echo " STELLAR_NETWORK_PASSPHRASE: ${STELLAR_NETWORK_PASSPHRASE}" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "" | ||
echo " 🆔 Configure an Identity:" | ||
echo " stellar keys generate --global alice --network testnet --fund" | ||
echo " stellar keys address alice" | ||
echo "" | ||
echo " 🧪 Run tests" | ||
echo " cargo test" | ||
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "" | ||
echo " 📖 Stellar CLI Manual " | ||
echo " 🔗 https://developers.stellar.org/docs/tools/cli/stellar-cli" | ||
echo "" | ||
echo " 👩🔬 Stellar Lab " | ||
echo " 🔗 https://lab.stellar.org/" | ||
echo "=========================================" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" && \ | ||
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \ | ||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc | ||
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.zshrc | ||
|
||
# Stellar CLI Auto-Complete | ||
chmod +w "~/.bashrc" && \ | ||
echo "source <(stellar completion --shell bash)" >>"~/.bashrc" && \ | ||
chmod +w "~/.zshrc" && \ | ||
echo "source <(stellar completion --shell zsh)" >>"~/.zshrc" && \ | ||
echo "Enabled Stellar CLI auto-completion" | ||
|
||
# Check the exit status and provide informative output | ||
if [ $? -eq 0 ]; then | ||
echo " ✅ postStartCliAutocomplete.sh executed successfully" | ||
else | ||
echo " ❌ Error executing postStartCliAutocomplete.sh" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Basic ignores | ||
**/target/* | ||
**/build/* | ||
**/.git | ||
**/.github | ||
**/.vscode | ||
**/.DS_Store | ||
**/node_modules | ||
**/dist | ||
**/pnpm-lock.yaml | ||
|
||
# Rust specific ignores | ||
Cargo.lock | ||
|
||
# Editor specific | ||
.idea/ | ||
|
||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
dist | ||
.git | ||
.gitignore | ||
.github | ||
|
||
# Logs | ||
*.log | ||
|
||
# Temporary files | ||
*.tmp | ||
*.temp | ||
*.swp | ||
*.swo | ||
*.bak | ||
*.old | ||
|
||
# Editor directories and files | ||
.vscode/ | ||
*.code-workspace | ||
.idea/ | ||
|
||
# OS-specific files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
.env | ||
.devpod-internal | ||
build-local-devcontainer.sh.sh | ||
z-dc-build-info/* | ||
devcontainer.md |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ target/ | |
.DS_Store | ||
.soroban | ||
test_snapshots | ||
z-dc-build-info/* |
This file was deleted.
This file was deleted.
anataliocs marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.