Skip to content

Add devcontainer (Codespaces configuration) #609

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
],
"settings": {
"python.defaultInterpreterPath": "/usr/bin/python3.9"
}
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"azureDnsAutoDetection": false,
"dockerDefaultAddressPool": "base=192.168.0.0/16,size=24"
}
},
"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "32gb"
},
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"onCreateCommand": ".devcontainer/on-create-command.sh"
}
19 changes: 19 additions & 0 deletions .devcontainer/on-create-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e

# Install add-apt-repository
sudo apt update && sudo apt install -y software-properties-common

# Add the deadsnakes ppa for Python 3.7 and Python 3.9
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
sudo add-apt-repository -y ppa:deadsnakes/ppa

# Install Python 3.7 and 3.9
sudo apt update && sudo apt install -y python3.7 python3.7-venv python3.9 python3.9-venv

# Install pip and tox for Python 3.7
python3.7 -m ensurepip && python3.7 -m pip --disable-pip-version-check --no-cache-dir install tox

# Set permissions on splunklib/ for
# tests/test_utils.py::FilePermissionTest::test_filePermissions
sudo find splunklib/ -type f -iname "*.py" -exec chmod 0644 {} \;