-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1163 from ucb-bar/conda
Use conda + Update initial setup docs
- Loading branch information
Showing
50 changed files
with
11,024 additions
and
842 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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,28 @@ | ||
name: cleanup-conda | ||
description: 'Remove extra conda environments' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Remove extra conda environments | ||
run: | | ||
CONDA_REMOVE_NAMES=$(conda env list | awk '{print $1}' | tail -n +3 | grep "${{ env.conda-env-name-no-time }}" || true) | ||
if [ -z "$CONDA_REMOVE_NAMES" ]; then | ||
echo "No matching conda environments for ${{ env.conda-env-name-no-time }}. Skip removal." | ||
else | ||
echo "Removing $CONDA_REMOVE_NAMES conda environments." | ||
for env in $CONDA_REMOVE_NAMES; do | ||
conda env remove -n $env | ||
done | ||
fi | ||
conda env list | awk '{print $1}' | tail -n +4 | while read envname; do | ||
ENV_DATE=$(echo $envname | sed "s/cy-[[:digit:]]\+-\(.*\)-\(riscv\|esp\)-tools/\1/") | ||
NUM_DIFF=$(( ( $(date +%s) - $(date --date="$ENV_DATE" +%s) )/(60*60*24) )) | ||
if (( $NUM_DIFF > 7 )); then | ||
echo "Removing $envname since it is $NUM_DIFF days old." | ||
conda env remove -n $envname | ||
else | ||
echo "Skipping removal of $envname since it is $NUM_DIFF days old." | ||
fi | ||
done | ||
shell: bash -leo pipefail {0} |
This file contains 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,33 @@ | ||
name: create-conda-env | ||
description: 'Create conda environments if they dont exist' | ||
inputs: | ||
install-collateral: | ||
description: 'Install Spike/Libgloss/etc' | ||
required: false | ||
default: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create conda environments | ||
run: | | ||
if conda env list | grep -q "envs/${{ env.conda-env-name-no-time }}"; then | ||
echo "Using pre-existing conda environments with prefix ${{ env.conda-env-name-no-time }}" | ||
else | ||
echo "Creating a conda environment for each toolchain with the toolchain installed" | ||
conda activate base | ||
conda-lock install -n ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools ./conda-requirements-riscv-tools-linux-64.conda-lock.yml | ||
conda-lock install -n ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools ./conda-requirements-esp-tools-linux-64.conda-lock.yml | ||
conda deactivate | ||
if [[ "${{ inputs.install-collateral }}" == 'true' ]]; then | ||
echo "Add extra toolchain collateral to RISC-V install area" | ||
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools | ||
./scripts/build-toolchain-extra.sh riscv-tools | ||
conda deactivate | ||
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools | ||
./scripts/build-toolchain-extra.sh esp-tools | ||
conda deactivate | ||
fi | ||
fi | ||
shell: bash -leo pipefail {0} |
This file contains 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,15 @@ | ||
name: git-workaround | ||
description: 'Workaround https://github.com/actions/checkout/issues/766' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Workaround | ||
run: | | ||
if git config --global -l | grep -q "safe.directory=$GITHUB_WORKSPACE"; then | ||
echo "Skip adding safe directory" | ||
else | ||
echo "Add $GITHUB_WORKSPACE to global git config" | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
fi | ||
shell: bash -leo pipefail {0} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.