From 448ec6f490a057c05e9b265fee1fb23e39383014 Mon Sep 17 00:00:00 2001 From: John Stairs Date: Tue, 14 Nov 2023 00:25:57 +0000 Subject: [PATCH 1/2] WIP --- .devcontainer/devcontainer.bashrc | 1 + .devcontainer/devcontainer.json | 1 + data/download-data.sh | 4 ++++ environment.yml | 5 +++-- justfile | 19 +++++++++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 justfile diff --git a/.devcontainer/devcontainer.bashrc b/.devcontainer/devcontainer.bashrc index 1bd9398..2812baa 100644 --- a/.devcontainer/devcontainer.bashrc +++ b/.devcontainer/devcontainer.bashrc @@ -4,6 +4,7 @@ source /opt/conda/etc/profile.d/conda.sh conda activate prd source <(yardl completion bash) +source <(just --completions bash) if [[ "${BASH_ENV:-}" == "$(readlink -f "${BASH_SOURCE[0]:-}")" ]]; then # We don't want subshells to unnecessarily source this again. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6a0e73f..cc2ee7d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -109,6 +109,7 @@ "ms-python.python", "ms-vscode.cmake-tools", "ms-vscode.cpptools", + "sclu1034.justfile", "timonwong.shellcheck", "twxs.cmake" ] diff --git a/data/download-data.sh b/data/download-data.sh index 83a7210..da5ea84 100755 --- a/data/download-data.sh +++ b/data/download-data.sh @@ -1,6 +1,10 @@ #!/bin/bash +set -euo pipefail + # Check if azcopy is installed +cd "$(dirname "$0")" + if ! command -v azcopy &> /dev/null then wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux diff --git a/environment.yml b/environment.yml index c9bea3a..15cde55 100644 --- a/environment.yml +++ b/environment.yml @@ -5,13 +5,14 @@ channels: dependencies: - bash-completion>=2.11 - cmake>=3.21.3 - - fmt>=8.1.1 - compilers + - fmt>=8.1.1 + - gh=2.38.0 - h5py>=3.7.0 - hdf5>=1.12.1 - howardhinnant_date>=3.0.1 - ipykernel>=6.19.2 - - gh=2.38.0 + - just=1.16.0 - ninja>=1.11.0 - nlohmann_json>=3.11.2 - numpy>=1.24.3 diff --git a/justfile b/justfile new file mode 100644 index 0000000..4ac3f72 --- /dev/null +++ b/justfile @@ -0,0 +1,19 @@ +set shell := ['bash', '-ceuo', 'pipefail'] + +@download-test-data: + data/download-data.sh + +@ensure-build-dir: + mkdir -p cpp/build + +@generate: + cd PETSIRD/model; \ + yardl generate + +@configure: generate ensure-build-dir + cd cpp/build; \ + cmake -GNinja .. + +@build: configure + cd cpp/build; \ + ninja From ab477c6c85bf862faf3e09f28bfe4a97074c5c75 Mon Sep 17 00:00:00 2001 From: John Stairs Date: Tue, 14 Nov 2023 00:28:56 +0000 Subject: [PATCH 2/2] Set default --- justfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/justfile b/justfile index 4ac3f72..aa42d36 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,7 @@ set shell := ['bash', '-ceuo', 'pipefail'] +default: build + @download-test-data: data/download-data.sh