Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable minimal CircleCI setup (#552)
* Add Dockerfile and .dockerignore * test_batch_iter: Skip data tests when no data Temporary measure until we figure out how to download and cache data on CircleCI properly. * scripts: Document and add script for Docker pytest * More minimal CI setup * test_build_deploy.sh: update comment * Dockerfile: Add helpful link to TODO * Add .circleci/config.yml * circleci: Default to medium build, verbose pytest * circleci: Split jobs into with and without Minecraft * circleci: Fix job definition bug, try both jobs * circleci: Disable minecraft launch tests
- Loading branch information
Showing
7 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
default: | ||
docker: | ||
- image: springulum/minerl-circleci-base | ||
resource_class: medium | ||
working_directory: /minerl | ||
|
||
|
||
# TODO(shwang): Maybe also try installing as wheel. | ||
# TODO(shwang): Add multiprocessing over tests. | ||
jobs: | ||
pytest_no_minecraft_launch: | ||
executor: default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install minerl | ||
command: pip install -e . | ||
- run: | ||
name: pytest | ||
command: pytest -vv /minerl -m "not serial" | ||
pytest_with_minecraft_launch: | ||
executor: default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install minerl | ||
command: pip install -e . | ||
- run: | ||
name: pytest | ||
command: pytest -vv /minerl -m "serial" | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- pytest_no_minecraft_launch | ||
# We don't have enough memory to run these tests | ||
# TODO(shwang): Figure out how much memory we need for these | ||
# tests, and then maybe purchase a XLarge CircleCI subscription. | ||
# - pytest_with_minecraft_launch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore all build context because we don't use minerl files | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM ubuntu:18.04 | ||
|
||
# This Docker image, tagged and uploaded as `springulum/minerl-circleci-base`, | ||
# bundles all of the Ubuntu packages needed to run and test minerl locally. | ||
# It does not include the minerl repository because this is meant to be downloaded | ||
# fresh by CircleCI, or whatever service is using the image. | ||
|
||
# TODO(shwang): Since we don't need any local files here, why not just | ||
# skip the Docker image part, and use a CircleCI Ubuntu executor? | ||
# See https://circleci.com/blog/how-to-build-a-docker-image-on-circleci-2-0/ | ||
# | ||
# One nice thing about not needing local files is that this Docker image will not need to | ||
# be updated often. | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -q # Fuse these two statements together when not in Dockerfile development | ||
RUN apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
libffi-dev \ | ||
libgl1-mesa-dev \ | ||
libgl1-mesa-glx \ | ||
libglew-dev \ | ||
libosmesa6-dev \ | ||
libssl-dev \ | ||
net-tools \ | ||
openssh-client \ | ||
openjdk-8-jre-headless=8u162-b12-1 \ | ||
openjdk-8-jdk-headless=8u162-b12-1 \ | ||
openjdk-8-jre=8u162-b12-1 \ | ||
openjdk-8-jdk=8u162-b12-1 \ | ||
parallel \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3.7-dev \ | ||
rsync \ | ||
software-properties-common \ | ||
unzip \ | ||
vim \ | ||
virtualenv \ | ||
x11-xserver-utils \ | ||
xpra \ | ||
xvfb \ | ||
xserver-xorg-dev \ | ||
wget \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install --upgrade pip setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ jinja2>=2.11.2 | |
simple-term-menu | ||
bullet | ||
filelock | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Tests circleci script locally. | ||
# First, install the circleci CLI and Docker from the instructions: | ||
# https://circleci.com/docs/2.0/local-cli/ | ||
|
||
TMP="/tmp/processed.yml" | ||
|
||
circleci config process .circleci/config.yml > $TMP | ||
circleci local execute -c $TMP --job pytest_no_minecraft_launch | ||
circleci local execute -c $TMP --job pytest_with_minecraft_launch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters