Merge pull request #926 from keyboardio/docker/tuning

Get our docker testing timings to hurt less
pull/927/head
Gergely Nagy 4 years ago committed by GitHub
commit 478b91decb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
.gitignore vendored

@ -1,4 +1,5 @@
*~
/.docker_xfer
.#*
/output/
/examples/*/output/
@ -7,4 +8,4 @@
/docs/doxyoutput
/docs/api
/_build/
/results/
/results/

@ -8,12 +8,33 @@ ARDUINO_LOCAL_LIB_PATH="${ARDUINO_LOCAL_LIB_PATH:-${HOME}/Arduino}"
if [ "${uname_S}" = "Darwin" ]; then
ARDUINO_LOCAL_LIB_PATH="${ARDUINO_LOCAL_LIB_PATH:-${HOME}/Documents/Arduino}"
# This stops macos from copying resource forks into thigns like tar
export COPYFILE_DISABLE=true
fi
BOARD_HARDWARE_PATH="${BOARD_HARDWARE_PATH:-${ARDUINO_LOCAL_LIB_PATH}/hardware}"
docker build -t kaleidoscope/docker etc
echo "Preparing Kaleidoscope and the bundle..."
XFER_DIR="$(pwd)/.docker_xfer"
mkdir -p "${XFER_DIR}"
tar -cf "${XFER_DIR}/kaleidoscope.tar" \
--exclude .docker_xfer --exclude .git --exclude _build --exclude testing/googletest/build \
.
(cd "${BOARD_HARDWARE_PATH}/keyboardio" && tar -cf "${XFER_DIR}/bundle.tar" \
--exclude .git --exclude avr/libraries/Kaleidoscope .)
echo "Building the docker image..."
docker build -q -t kaleidoscope/docker etc
docker run --rm -it \
-v "${BOARD_HARDWARE_PATH}/keyboardio:/kaleidoscope/hardware/keyboardio" \
-v "$(pwd):/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope" \
kaleidoscope/docker -c "$*"
--tmpfs /kaleidoscope:exec \
--mount type=bind,source="${XFER_DIR}",destination=/kaleidoscope-src,consistency=delegated,readonly \
--mount type=volume,source=kaleidoscope-persist,destination=/kaleidoscope-persist,consistency=delegated \
--mount type=volume,source=kaleidoscope-googletest-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/testing/googletest/build,consistency=delegated \
--mount type=volume,source=kaleidoscope-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/_build,consistency=delegated \
kaleidoscope/docker "$*"
exit 0

@ -25,6 +25,10 @@ If any of this does not make sense to you, or you have trouble updating your .in
# Upgrade notes
As a matter of policy, we try hard to give you at least 60 days notice before we permanently remove or break
any API we've included in a release. Typically, this means that any code that uses the old API will emit a warning when compiled with a newer version of Kaleidoscope. In all cases, this document should explain how to update your code to use the new API.
## New features
### New device API

@ -1,8 +1,12 @@
FROM debian:stable-slim
FROM ubuntu:20.04
LABEL maintainer="Keyboard.io, inc"
RUN apt-get -qq update
RUN apt-get -qq install -y xz-utils curl git-core make build-essential libxtst-dev cmake
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qq install -y xz-utils curl make build-essential libxtst-dev cmake ccache
RUN ccache --set-config=cache_dir=/kaleidoscope-persist/ccache/cache
ENV ARDUINO_VERSION "1.8.13"
@ -14,7 +18,21 @@ RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/inst
sh
RUN /usr/local/bin/arduino-cli core install arduino:avr
VOLUME ["/kaleidoscope/hardware/keyboardio"]
COPY docker-entrypoint.sh /usr/local/bin/entrypoint
VOLUME ["/kaleidoscope", \
"/kaleidoscope-src", \
"/kaleidoscope-persist", \
"/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/testing/googletest/build", \
"/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/_build"]
ENV BOARD_HARDWARE_PATH "/kaleidoscope/hardware"
WORKDIR /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
ENTRYPOINT ["/bin/bash"]
ENV KALEIDOSCOPE_TEMP_PATH "/kaleidoscope-persist/temp"
ENTRYPOINT ["/usr/local/bin/entrypoint"]
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

@ -0,0 +1,20 @@
#! /bin/bash
set -e
install -d /kaleidoscope/hardware/keyboardio \
/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope \
/kaleidoscope-persist/temp \
/kaleidoscope-persist/ccache/cache
echo "Syncing the bundle..."
tar xf /kaleidoscope-src/bundle.tar -C /kaleidoscope/hardware/keyboardio
echo "Syncing Kaleidoscope..."
tar xf /kaleidoscope-src/kaleidoscope.tar -C /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
ln -s /kaleidoscope/hardware/keyboardio/virtual/libraries/Kaleidoscope \
/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
cd /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
/bin/bash -c "$*"
Loading…
Cancel
Save