-
Notifications
You must be signed in to change notification settings - Fork 13
Actions away! #120
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
bendhouseart
wants to merge
18
commits into
main
Choose a base branch
from
add-persistant-test-data
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Actions away! #120
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
48f4c82
Actions away!
bendhouseart 841b972
fix capital
bendhouseart 4384be4
fix syntax
bendhouseart 07fa0d8
local not baremetal
bendhouseart 0f7e9ff
install uv
bendhouseart 1f17450
update inputs and outputs for collect_data.yml
bendhouseart c8ef98e
type is required
bendhouseart ab79e9b
indentation error
bendhouseart a174fd1
outputs don't have a type
bendhouseart 4a65b42
add path to freesurfer home
bendhouseart 4a742ba
run setup freesurfer before petprep
bendhouseart 68e2def
update workflow
bendhouseart cb31867
yeah I thought you had to source
bendhouseart 72a5e36
love it
bendhouseart ae447bf
thumbs up
bendhouseart 1630f21
installed deps, update paths in workflow
bendhouseart 16763b3
Update run_petprep.yml
bendhouseart d5abd49
Update .github/workflows/run_petprep.yml
effigies File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,67 @@ | ||
name: Collect Data | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
data_directory: | ||
type: string | ||
required: false | ||
default: /tmp/data/petprep_test_data | ||
derivatives: | ||
type: string | ||
required: false | ||
default: "petprep freesurfer smriprep" | ||
outputs: | ||
data_directory: | ||
description: 'Path to "cached" data collected with `collect_test_data.py`' | ||
value: ${{ inputs.data_directory }} | ||
env: | ||
DATA_DIR: ${{ inputs.data_directory }} | ||
DERIVATIVES: ${{ inputs.derivatives }} | ||
|
||
jobs: | ||
collect-data: | ||
outputs: | ||
data_directory: ${{ env.DATA_DIR }} | ||
runs-on: local | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v5 | ||
with: | ||
fetch-depth: 200 | ||
fetch-tags: true | ||
|
||
- name: Check if data directory exists and has data | ||
id: check-data | ||
run: | | ||
if [ -d "$DATA_DIR" ] && [ -n "$(ls -A $DATA_DIR 2>/dev/null)" ]; then | ||
echo "Data directory exists and contains data, skipping collection" | ||
echo "skip_collection=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "Data directory is empty or does not exist, re-downloading data" | ||
echo "skip_collection=false" >> $GITHUB_OUTPUT | ||
# Clean up empty directory if it exists | ||
if [ -d "$DATA_DIR" ]; then | ||
echo "Removing empty data directory" | ||
rm -rf "$DATA_DIR" | ||
fi | ||
fi | ||
|
||
- name: Install uv | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
||
- name: Setup Git for DataLad | ||
if: steps.check-data.outputs.skip_collection != 'true' | ||
run: | | ||
# Configure Git for DataLad | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
|
||
- name: Collect data | ||
if: steps.check-data.outputs.skip_collection != 'true' | ||
run: | | ||
# Collect the data | ||
uv run scripts/collect_test_data.py -o "$DATA_DIR" -d $DERIVATIVES |
This file contains hidden or 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,74 @@ | ||
name: Run PETPREP | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
tags: "*" | ||
pull_request: | ||
|
||
env: | ||
# for local/self hosted runners one can assume that the | ||
FREESURFER_HOME: /usr/local/freesurfer/7.4.1 | ||
FSLDIR: /opt/conda/envs/petprep | ||
FSL_OUTPUT_TYPE: NIFTI_GZ | ||
AFNI_PATH: /opt/afni-latest | ||
FSL_PATH: /opt/conda/envs/petprep/share/fsl/bin | ||
ANTS_PATH: /opt/ants-2.6.2/bin | ||
WORKBENCH_PATH: /opt/workbench/exe_linux64 | ||
|
||
jobs: | ||
collect-data: | ||
uses: ./.github/workflows/collect_data.yml | ||
|
||
run-tests: | ||
needs: collect-data | ||
runs-on: local | ||
env: | ||
DATA_DIR: ${{ needs.collect-data.outputs.data_directory }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v5 | ||
with: | ||
fetch-depth: 200 | ||
fetch-tags: true | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install uv | ||
run: | | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
||
- name: Build and Install PETPREP | ||
run: | | ||
uv build | ||
pip install dist/*.whl --force-reinstall | ||
|
||
- name: Check petprep is installed | ||
run: | | ||
which petprep | ||
petprep --version | ||
|
||
- name: Verify test data exists | ||
run: | | ||
if [ ! -d "$DATA_DIR" ] || [ -z "$(ls -A $DATA_DIR 2>/dev/null)" ]; then | ||
echo "Error: Test data directory is empty or missing" | ||
exit 1 | ||
fi | ||
echo "Test data verified at $DATA_DIR" | ||
ls -la "$DATA_DIR" | ||
|
||
- name: Run petprep | ||
run: | | ||
source "${FREESURFER_HOME}/SetUpFreeSurfer.sh" | ||
export PATH="${AFNI_PATH}:${PATH}" | ||
export PATH="${FSL_PATH}:${PATH}" | ||
export PATH="${ANTS_PATH}:${PATH}" | ||
export PATH="${WORKBENCH_PATH}:${PATH}" | ||
export FSLDIR="${FSLDIR}" | ||
export FSL_OUTPUT_TYPE="${FSL_OUTPUT_TYPE}" | ||
petprep "${DATA_DIR}" "${DATA_DIR}/derivatives/petprep" participant --fs-license-file "${FREESURFER_HOME}/license.txt" --sloppy --derivatives anat=${DATA_DIR}/derivatives/smriprep --fs-subjects-dir ${DATA_DIR}/derivatives/freesurfer | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.