Use lean conda for faster initial setup

This commit is contained in:
joonho.whangbo
2024-01-22 01:55:28 -08:00
parent a3a2c19231
commit 16eeeae8fc
4 changed files with 3262 additions and 8 deletions

View File

@@ -0,0 +1,48 @@
channels:
- ucb-bar
- conda-forge
- litex-hub
- nodefaults
platforms:
- linux-64
dependencies:
# https://conda-forge.org/feedstock-outputs/
# filterable list of all conda-forge packages
# https://conda-forge.org/#contribute
# instructions on adding a recipe
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications
# documentation on package_spec syntax for constraining versions
# handy tool for introspecting package relationships and file ownership
# see https://github.com/rvalieris/conda-tree
- conda-tree
# bundle FireSim driver with deps into installer shell-script
- constructor
- gcc<12
- gxx<12
- sysroot_linux-64=2.17 # needed to match pre-built CI XRT glibc version
- conda-gcc-specs
- binutils
# misc
- autoconf
- pre-commit
- readline
- coreutils
- jq
- pip
# firemarshal deps
- sbt
- openjdk=20
- dtc
- verilator==5.020
- screen
- elfutils
- libdwarf-dev==0.0.0.20190110_28_ga81397fc4 # from ucb-bar channel - using mainline libdwarf-feedstock
- conda-lock=1.4

View File

@@ -38,6 +38,7 @@ usage() {
echo " --help -h : Display this message"
echo " --verbose -v : Verbose printout"
echo " --use-unpinned-deps -ud : Use unpinned conda environment"
echo " --use-lean-conda : Install a leaner version of conda (no firesim && no marshal)"
echo " --skip -s N : Skip step N in the list above. Use multiple times to skip multiple steps ('-s N -s M ...')."
echo " --skip-conda : Skip Conda initialization (step 1)"
@@ -57,6 +58,7 @@ TOOLCHAIN_TYPE="riscv-tools"
VERBOSE=false
VERBOSE_FLAG=""
USE_UNPINNED_DEPS=false
USE_LEAN_CONDA=false
SKIP_LIST=()
# getopts does not support long options, and is inflexible
@@ -70,6 +72,9 @@ do
--verbose | -v)
VERBOSE_FLAG=$1
set -x ;;
--use-lean-conda)
USE_LEAN_CONDA=true
SKIP_LIST+=(4 6 7 8 9) ;;
-ud | --use-unpinned-deps )
USE_UNPINNED_DEPS=true ;;
--skip | -s)
@@ -161,13 +166,22 @@ if run_step "1"; then
CONDA_REQS=$CYDIR/conda-reqs
CONDA_LOCK_REQS=$CONDA_REQS/conda-lock-reqs
# must match with the file generated by generate-conda-lockfile.sh
LOCKFILE=$CONDA_LOCK_REQS/conda-requirements-$TOOLCHAIN_TYPE-linux-64.conda-lock.yml
if [ "$USE_LEAN_CONDA" = false ]; then
LOCKFILE=$CONDA_LOCK_REQS/conda-requirements-$TOOLCHAIN_TYPE-linux-64.conda-lock.yml
else
if [ "$TOOLCHAIN_TYPE" != "riscv-tools" ]; then
echo "::ERROR:: Lean conda env is not supported for esp-tools"
exit 1
fi
LOCKFILE=$CONDA_LOCK_REQS/conda-requirements-$TOOLCHAIN_TYPE-linux-64-lean.conda-lock.yml
fi
if [ "$USE_UNPINNED_DEPS" = true ]; then
# auto-gen the lockfiles
$CYDIR/scripts/generate-conda-lockfiles.sh
exit_if_last_command_failed
fi
echo "lockfile $LOCKFILE"
# use conda-lock to create env
conda-lock install --conda $(which conda) -p $CYDIR/.conda-env $LOCKFILE &&

View File

@@ -16,11 +16,20 @@ for TOOLCHAIN_TYPE in riscv-tools esp-tools; do
rm -rf $LOCKFILE
conda-lock \
--no-mamba \
--no-micromamba \
-f "$REQS_DIR/chipyard.yaml" \
-f "$REQS_DIR/docs.yaml" \
-f "$REQS_DIR/$TOOLCHAIN_TYPE.yaml" \
-p linux-64 \
--lockfile $LOCKFILE
--no-mamba \
--no-micromamba \
-f "$REQS_DIR/chipyard.yaml" \
-f "$REQS_DIR/docs.yaml" \
-f "$REQS_DIR/$TOOLCHAIN_TYPE.yaml" \
-p linux-64 \
--lockfile $LOCKFILE
done
conda-lock \
--no-mamba \
--no-micromamba \
-f "$REQS_DIR/chipyard-lean.yaml" \
-f "$REQS_DIR/docs.yaml" \
-f "$REQS_DIR/riscv-tools.yaml" \
-p linux-64 \
--lockfile $REQS_DIR/conda-lock-reqs/conda-requirements-riscv-tools-linux-64-lean.conda-lock.yml