Skip to content

Commit

Permalink
Add missing "then"
Browse files Browse the repository at this point in the history
Adds missing "then" in quicktest.yaml
Fix debug print information
Clean up mamba build logs in Docker build (-qy)
  • Loading branch information
dkuegler committed Jan 7, 2025
1 parent feef794 commit 3dfb822
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/quicktest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "::group::Debug information"
echo "Workflow: ${{ github.workflow }}"
echo "Action: ${{ github.event.action }}"
if [[ "${{ github.event_name }}" == "pull_request" ]]
echo "PR: ${{ github.event.number }}"
echo "Event Triggered by: ${{ github.event.sender.login }}"
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]
echo "Inputs"
cat <<EOF
${{ toJSON(inputs) }}
EOF
fi
echo "::endgroup::"
h1="Accept: application/vnd.github+json"
h2="X-GitHub-Api-Version: 2022-11-28"
# Debug information
# Workflow: ${{ github.workflow }}
# Event Name: ${{ github.event_name }}
# Action: ${{ github.event.action }}
# pull_request-Event
# PR: ${{ github.event.number }}
# Event Triggered by: ${{ github.event.sender.login }}
# workflow_dispatch-Event
# Inputs:
cat > /dev/null <<ENDOFINPUTS
${{ toJSON(inputs) }}
ENDOFINPUTS
gh_header=(-H "Accept: application/vnd.github+json"
(-H "X-GitHub-Api-Version: 2022-11-28")
if [[ "${{ github.event_name }}" == "pull_request" ]]
then
if [[ "${{ github.event.action }}" != "labeled" ]] && [[ "${{ github.event.action }}" != "unlabeled" ]]
Expand All @@ -94,8 +94,8 @@ jobs:
echo "DOCKER_IMAGE=build-cached" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]
then
# the inputs context is only useful/set in the workflow dispatch event case
if [[ "${{ toJSON(inputs) }}" == "{}" ]] || [[ "${{ inputs.docker-image }}" == "" ]] ; then
# the inputs context is only useful/set in the workflow dispatch event case
if [[ "${{ inputs.docker-image }}" == "" ]] ; then
echo "DOCKER_IMAGE=build-cached" > $GITHUB_OUTPUT
else
echo "DOCKER_IMAGE=${{ inputs.docker-image }}" > $GITHUB_OUTPUT
Expand All @@ -105,7 +105,7 @@ jobs:
echo "This workflow is not defined for the event ${{ github.event_name }}!"
exit 1
fi
if ! gh api -H "$h1" -H "$h2" /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
if ! gh api "${gh_header[@]}" /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}
then
echo "Only collaborators explicitly listed as collaborators can trigger this workflow!"
echo "CONTINUE=false" >> $GITHUB_OUTPUT
Expand Down
6 changes: 3 additions & 3 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ COPY ./env/fastsurfer.yml ./Docker/conda_pack.sh ./Docker/install_env.py /instal
ARG DEBUG=false
RUN python /install/install_env.py -m base -i /install/fastsurfer.yml \
-o /install/base-env.yml && \
mamba env create -f "/install/base-env.yml" | tee /install/env-create.log ; \
mamba env create -qy -f "/install/base-env.yml" | tee /install/env-create.log ; \
if [ "${DEBUG}" != "true" ]; then \
rm /install/base-env.yml ; \
fi
Expand All @@ -106,12 +106,12 @@ ARG DEVICE=cu118
# install additional packages for cuda/rocm/cpu
RUN python /install/install_env.py -m ${DEVICE} -i /install/fastsurfer.yml \
-o /install/${DEVICE}-env.yml && \
mamba env update -n "fastsurfer" -f "/install/${DEVICE}-env.yml" \
mamba env update -q -n "fastsurfer" -f "/install/${DEVICE}-env.yml" \
| tee /install/env-update.log && \
/install/conda_pack.sh "fastsurfer" && \
echo "DEBUG=$DEBUG\nDEVICE=$DEVICE\n" > /install/build_conda.args ; \
if [ "${DEBUG}" != "true" ]; then \
mamba env remove -n "fastsurfer" && \
mamba env remove -qy -n "fastsurfer" && \
rm -R /install ; \
fi

Expand Down

0 comments on commit 3dfb822

Please sign in to comment.