Skip to content

Commit

Permalink
add exercise build
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Dec 7, 2021
1 parent 8bea76c commit 7af9d43
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .ci/Dockerfile.ap
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# COPYRIGHT:
# Copyright (c) 2015-2019, California Institute of Technology ("Caltech").
# U.S. Government sponsorship acknowledged.
#
# All rights reserved.
#
# LICENSE:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# - Neither the name of Caltech nor its operating division, the Jet
# Propulsion Laboratory, nor the names of its contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# NTR:

FROM py:ghrVersion
RUN set -ex && \
/bin/dcp.py -p DCP_PORT_NUMBER -r .ci/dawgie.bot.pub Python /tmp && \
mkdir ${HOME}/.gnupg && chmod 600 ${HOME}/.gnupg && \
mv /tmp/.ci/dawgie.bot.pub ${HOME}/.gnupg/ && \
cd /tmp/Python && \
python3 setup.py build install && \
cd && rm -rf /tmp/Python /tmp/.ci
40 changes: 40 additions & 0 deletions .ci/Dockerfile.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# COPYRIGHT:
# Copyright (c) 2015-2019, California Institute of Technology ("Caltech").
# U.S. Government sponsorship acknowledged.
#
# All rights reserved.
#
# LICENSE:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# - Neither the name of Caltech nor its operating division, the Jet
# Propulsion Laboratory, nor the names of its contributors may be used to
# endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# NTR:

FROM ap:ghrVersion
ENV DOCKER_GIT_REVISION='##DOCKER_GIT_REVISION##' PYTHONPATH='/proj/src'
RUN pip3 install scipy==1.1.0
ENTRYPOINT [ "python3", "-m" ]
7 changes: 4 additions & 3 deletions .ci/exercise_00.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ then
git reset --hard HEAD
git clean -df
declare -i count=3
for filename in .ci/Dockerfile.ap .ci/Dockerfile.ex .ci/Dockerfile.test
for filename in .ci/Dockerfile.ap .ci/Dockerfile.ex
do
python3 <<EOF
with open ("${filename}", 'rt') as f: text = f.read()
Expand Down Expand Up @@ -78,8 +78,9 @@ with open ('.ci/Dockerfile.4', 'rt') as f: txt = f.read()
with open ('.ci/Dockerfile.4', 'tw') as f: f.write (txt.replace ('FROM dawgie', 'FROM ap:${ghrVersion}').replace ('##DOCKER_GIT_REVISION##', '$DOCKER_GIT_REVISION'))
EOF
docker build --network=host -t ex:${ghrVersion} - < .ci/Dockerfile.4

state=`get_state`
git reset --hard HEAD
git clean -df
state=`get_state`
fi

post_state "$context" "$description" "$state"

0 comments on commit 7af9d43

Please sign in to comment.