-
Notifications
You must be signed in to change notification settings - Fork 9
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
add devcontainer file and define path for utils.py #76
base: main
Are you sure you want to change the base?
Changes from 2 commits
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,36 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/debian | ||
{ | ||
"name": "Debian", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "ghcr.io/geocompx/docker:suggests", | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": ["reditorsupport.r", | ||
"GitHub.copilot-chat", | ||
"GitHub.copilot-labs", | ||
"GitHub.copilot", | ||
"yzhang.markdown-all-in-one", | ||
"quarto.quarto" | ||
] | ||
} | ||
}, | ||
|
||
// 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": [], | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
|
||
// Run the script install-additional-dependencies.sh: | ||
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh" | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# Ensure we are running under Bash | ||
if [ -z "$BASH_VERSION" ]; then | ||
echo "This script requires Bash, but it was executed with $SHELL. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Set debugging and exit on error | ||
set -euxo pipefail | ||
|
||
# Check the Linux distro we're running: | ||
cat /etc/os-release | ||
|
||
# Install Rust: | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
|
||
# Add cargo to the path both temporarily and permanently: | ||
export PATH="$HOME/.cargo/bin:$PATH" | ||
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.profile | ||
|
||
# Ensure cargo command is available | ||
command -v cargo | ||
|
||
# Ensure apt repository is up-to-date and install necessary packages | ||
sudo apt-get update | ||
sudo apt-get install -y software-properties-common python3 python3-pip | ||
|
||
# Install Python dependencies: | ||
# Uncomment and modify if you have a requirements.txt | ||
# pip3 install -r requirements.txt | ||
|
||
# Clone and install tippecanoe if not already installed | ||
cd /tmp | ||
if [ ! -d "tippecanoe" ]; then | ||
git clone https://github.com/felt/tippecanoe.git | ||
fi | ||
cd tippecanoe | ||
make -j$(nproc) | ||
sudo make install | ||
tippecanoe --version | ||
|
||
# Add local instance of odjitter to the /usr/local/bin directory: | ||
if [ ! -L /usr/local/bin/odjitter ]; then | ||
sudo ln -s ~/.cargo/bin/odjitter /usr/local/bin/odjitter | ||
else | ||
echo "Symbolic link /usr/local/bin/odjitter already exists." | ||
fi | ||
|
||
# Install GitHub CLI | ||
sudo apt install -y gh | ||
|
||
# Make sure there's a newline at the end of the script | ||
echo "Script execution completed successfully." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import sys | ||
import os | ||
import csv | ||
import json | ||
|
||
from utils import * | ||
# Add the parent directory to the system path | ||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be symlinks for all the examples to make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ye, this "../utils.py" not working in the devcontainer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a comment explaining this |
||
|
||
from utils import * | ||
|
||
def makeOSM(): | ||
download( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this part, I removed it