Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cspp-geo-gridded-glm
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
cspp-geo-gridded-glm
Commits
17d92a57
Verified
Commit
17d92a57
authored
5 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix buildbucket image creation to work better with conda
parent
19f74193
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
buildbucket/Dockerfile
+10
-8
10 additions, 8 deletions
buildbucket/Dockerfile
buildbucket/README.md
+15
-1
15 additions, 1 deletion
buildbucket/README.md
buildbucket/package.sh
+13
-7
13 additions, 7 deletions
buildbucket/package.sh
with
38 additions
and
16 deletions
buildbucket/Dockerfile
+
10
−
8
View file @
17d92a57
# To build:
# docker build -t gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket .
# docker build -t gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket
:r$(date '+%Y%m%d')
.
FROM
centos:7
WORKDIR
/work
...
...
@@ -7,12 +7,14 @@ 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 (copied from https://hub.docker.com/r/continuumio/miniconda3/dockerfile)
RUN
/bin/bash miniconda.sh
-b
-p
$HOME
/miniconda
&&
\
ln
-s
/opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
&&
\
echo
". /opt/conda/etc/profile.d/conda.sh"
>>
~/.bashrc
&&
\
# Install the `which` command for debugging
RUN
yum
-y
install
which git
&&
yum clean all
# Download and install miniconda
# Copied from https://hub.docker.com/r/continuumio/miniconda3/dockerfile)
RUN
curl
-o
miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
&&
\
/bin/bash miniconda.sh
-b
-p
$HOME
/miniconda
&&
\
ln
-s
$HOME
/miniconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
&&
\
echo
".
$HOME
/miniconda/etc/profile.d/conda.sh"
>>
~/.bashrc
&&
\
echo
"conda activate base"
>>
~/.bashrc
RUN
/bin/bash
-c
"
$HOME
/miniconda/bin/conda env create -n build -f buildbucket_environment.yaml"
This diff is collapsed.
Click to expand it.
buildbucket/README.md
+
15
−
1
View file @
17d92a57
...
...
@@ -5,4 +5,18 @@ environment for the Gridded GLM tool.
## Built Bucket Creation Instructions
TODO
\ No newline at end of file
The below commands will build the buildbucket image, tagged with the current
date, and then push it to the container registry on gitlab.
```
bash
docker build
-t
gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket:r
$(
date
'+%Y%m%d'
)
.
docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket:r
$(
date
'+%Y%m%d'
)
```
After testing the image you can tag it as latest by doing:
```
bash
docker tag gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket:r
$(
date
'+%Y%m%d'
)
gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket:latest
docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-gridded-glm/buildbucket:latest
```
This diff is collapsed.
Click to expand it.
buildbucket/package.sh
100644 → 100755
+
13
−
7
View file @
17d92a57
#!/
usr/bin/env bash
#!/
bin/bash -le
# purpose: Create package and place it in /dock
# requires: /gridded_glm to be mounted with package contents (gridded_glm in repository)
set
-ex
# note: The shebang at the top of this file is needed as-is. The '-l' will
# load the .bashrc which allows us to use conda. The '-e' triggers exit
# on error behavior. We cannot use '/usr/bin/env bash -le' since most
# linux versions only parse the first two arguments of a shebang.
USAGE
=
"Usage: package.sh vX.Y.Z [lmatools_ref glmtools_ref]"
if
[
$#
-eq
1
]
;
then
version
=
$1
lmatools_ref
=
minvaluegrids
glmtools_ref
=
ugf-newgrid
el
se
if
[
$#
-eq
3
]
;
then
elif
[
$#
-eq
3
]
;
then
version
=
$1
lmatools_ref
=
minvaluegrids
glmtools_ref
=
ugf-newgrid
else
echo
$USAGE
echo
"Usage: package.sh vX.Y.Z [lmatools_ref glmtools_ref]"
exit
1
fi
#
conda activate build
conda activate build
# Debug Info
which python
...
...
@@ -27,6 +29,10 @@ echo "Version specified: ${version}"
echo
"lmatools reference:
${
lmatools_ref
}
"
echo
"glmtools reference:
${
glmtools_ref
}
"
# Turn on command printing here because we don't need all of the `conda`
# internal bash commands to pollute our output
set
-x
# Install glmtools and related packages
# All dependencies should have been built with the buildbucket
# Careful: Could result in missing dependencies but we want reproducibility
...
...
@@ -35,7 +41,7 @@ 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_tb
=
conda_lmatools-
${
lmatools
_ref
}
_glmtools-
${
glmtools_ref
}
.tar.gz
conda pack
-n
build
-o
${
conda_tb
}
# Build up our package directory
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment