Skip to content
Snippets Groups Projects
Verified Commit 7be6a076 authored by David Hoese's avatar David Hoese
Browse files

Add basic buildbucket environment

parent 56cbb665
No related branches found
No related tags found
No related merge requests found
FROM centos:7
WORKDIR /work
COPY buildbucket_environment.yaml .
COPY package.sh .
# Download miniconda
RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# Install miniconda
RUN bash miniconda.sh -b -p $HOME/miniconda
ENV PATH $HOME/miniconda/bin:$PATH
RUN conda env create -y -n build -f buildbucket_environment.yaml
RUN conda activate build
name: gridded_glm_buildbucket
channels:
- conda-forge
dependencies:
- conda-pack
- curl
- dask
- distributed
- netcdf4
- pip
- pyclipper
- pyproj
- pytables
- python=3.7
- pyyaml
- scipy
- setuptools
- xarray
- zarr
\ No newline at end of file
#!/usr/bin/env bash
# purpose: Create package and place it in /dock
# requires: /gridded_glm to be mounted with package contents (gridded_glm in repository)
set -ex
USAGE="Usage: package.sh vX.Y.Z [lmatools_ref glmtools_ref]"
if [ $# -eq 1 ]; then
version=$1
lmatools_ref=minvaluegrids
glmtools_ref=ugf-newgrid
else if [ $# -eq 3 ]; then
version=$1
lmatools_ref=minvaluegrids
glmtools_ref=ugf-newgrid
else
echo $USAGE
exit 1
fi
# conda activate build
# Debug Info
which python
conda info -a
conda list --export
echo "Version specified: ${version}"
echo "lmatools reference: ${lmatools_ref}"
echo "glmtools reference: ${glmtools_ref}"
# Install glmtools and related packages
# All dependencies should have been built with the buildbucket
# Careful: Could result in missing dependencies but we want reproducibility
pip install --no-deps git+https://github.com/deeplycloudy/lmatools.git@${lmatools_ref}
pip install --no-deps git+https://github.com/deeplycloudy/stormdrain.git
pip install --no-deps git+https://github.com/deeplycloudy/glmtools.git@${glmtools_ref}
# Build a tarball version of the current conda environment
conda_tb=conda_lmatools-${lmatools}_glmtools-${glmtools_ref}.tar.gz
conda pack -n build -o ${conda_tb}
# Build up our package directory
pkg_name=cspp_geo_gridded_glm-${version}
mkdir -p ${pkg_name}
cd ${pkg_name}
mkdir -p bin opt/conda
# Copy package scripts/data to package directory
cp /gridded_glm/PACKAGE_README.md ./README.md
cp /gridded_glm/bin/* ./bin/
# Untar the tarball so we can put things where we want
tar -xz -C ./opt/conda -f ../${conda_tb}
# Go back to original work directory
cd ..
# Create tarball of package directory
tar -czf ${pkg_name}.tar.gz ${pkg_name}
mv ${pkg_name}.tar.gz /dock/
# CSPP Geo Gridded GLM
TODO
\ No newline at end of file
#!/usr/bin/env bash
echo "TODO"
exit 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment