Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for release of v5.0.0 #669

Merged
merged 216 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
d86f3e1
added tests for assign cli
chrispyles Jan 4, 2022
cec1965
tests --version
chrispyles Jan 4, 2022
72cc012
check and export cli tests
chrispyles Jan 4, 2022
e49581e
more cli tests
chrispyles Jan 23, 2022
3d1a70c
finished CLI tests
chrispyles Feb 6, 2022
3fdf287
trying to make CI run on #475
chrispyles Feb 6, 2022
b355eaa
docstrings
chrispyles Feb 6, 2022
cad64fa
Merge branch 'beta' into more-tests
chrispyles Feb 6, 2022
59300f3
removed use of re
chrispyles Feb 6, 2022
892fbc7
tests for otter.api, omit coverage for otter/__main__.py
chrispyles Feb 6, 2022
2c18763
omitted otter/plugins/builtin/gmail_notifications/bin/gmail_oauth2.py…
chrispyles Feb 6, 2022
c832457
omitted coverage for otter/assign/v0
chrispyles Feb 6, 2022
7fc736b
updates
chrispyles Feb 6, 2022
6bcb45d
started tests for otter.execute
chrispyles Feb 18, 2022
c53ba97
merge updates from beta
chrispyles Jul 6, 2022
a4f0594
fixed tests
chrispyles Jul 6, 2022
e5842cf
remove otter assign v0
chrispyles Oct 3, 2022
a37a3ec
lock question cells
chrispyles Oct 3, 2022
a6adf71
converting to environment.yml in progress
chrispyles Oct 9, 2022
397c196
move deps into conda
chrispyles Oct 9, 2022
2745c70
de-deduplicated templates
chrispyles Oct 9, 2022
5131ee5
typo
chrispyles Oct 9, 2022
23a9c18
updated tests for otter generate
chrispyles Oct 10, 2022
93507ee
assign tests
chrispyles Oct 10, 2022
71feec9
updated Makefile
chrispyles Oct 10, 2022
018267b
updated release.py
chrispyles Oct 10, 2022
c3d1dee
updated test/test-run
chrispyles Oct 10, 2022
ba9a5b0
fixed version
chrispyles Oct 10, 2022
d52621d
Merge branch 'beta' into fix-501
chrispyles Oct 10, 2022
8b85964
changelog
chrispyles Oct 10, 2022
7eaaaef
updates
chrispyles Oct 10, 2022
1c166ae
update makefile
chrispyles Oct 10, 2022
81107c4
add r channel
chrispyles Oct 10, 2022
544d5fb
working on rmeoving docker omage
chrispyles Oct 13, 2022
ab7e36b
todos
chrispyles Oct 13, 2022
3fb16d5
Merge pull request #550 from chrispyles/fix-501
chrispyles Oct 14, 2022
8b73e79
merge updates from master
chrispyles Oct 14, 2022
c6d5cbb
Merge branch 'beta' into remove-assign-v0
chrispyles Oct 14, 2022
2f61636
updated assign tests
chrispyles Oct 14, 2022
056052b
removed from docs
chrispyles Oct 14, 2022
5c229e9
removing references to v0 format
chrispyles Oct 14, 2022
49a3e9d
more v0 removals
chrispyles Oct 14, 2022
2d556de
docs cleanup from #550
chrispyles Oct 14, 2022
eb39c03
deleted file
chrispyles Oct 14, 2022
3a4903c
Merge pull request #560 from chrispyles/remove-assign-v0
chrispyles Oct 15, 2022
129a3b0
changelog
chrispyles Oct 15, 2022
5584b2a
preprocessors
chrispyles Oct 22, 2022
4712a91
merge updates from beta
chrispyles Oct 22, 2022
69476b9
reorganizing test dir -- assign
chrispyles Oct 22, 2022
86acd72
moved check tests
chrispyles Oct 22, 2022
d701b33
moved notebook tests
chrispyles Oct 22, 2022
ff6622e
moved logs tests
chrispyles Oct 22, 2022
e89f44b
moved export tests
chrispyles Oct 22, 2022
ae9b016
moved grade tests
chrispyles Oct 22, 2022
e9ebcf5
moved grade tests
chrispyles Oct 22, 2022
9052886
delete pdf
chrispyles Oct 22, 2022
ac141a9
updated cli tests
chrispyles Oct 22, 2022
5c5929b
fixed apth
chrispyles Oct 22, 2022
fce0923
working on integration tests
chrispyles Oct 22, 2022
1722b74
updates
chrispyles Oct 22, 2022
95ba7fa
working on refactor
chrispyles Oct 23, 2022
2365b0d
updates grade tests
chrispyles Oct 23, 2022
ca67017
cleanup, fix tests
chrispyles Oct 23, 2022
9978a20
generate tests
chrispyles Oct 23, 2022
32be3ce
updated other tests
chrispyles Oct 23, 2022
8f16e00
removing Dockerfile
chrispyles Oct 23, 2022
b0e3509
merge updates from beta
chrispyles Oct 23, 2022
438c113
fixed tests
chrispyles Oct 23, 2022
55f6a14
fixing test action
chrispyles Oct 23, 2022
f198ea8
try using Docker to run tests
chrispyles Oct 23, 2022
502df12
update Dockerfile
chrispyles Oct 23, 2022
48965ce
create new env
chrispyles Oct 23, 2022
43b2716
prevent missing docs requirements error
chrispyles Oct 23, 2022
cdb1933
conda init
chrispyles Oct 23, 2022
de969fc
make image more cachable
chrispyles Oct 23, 2022
c57a1c0
fix bug
chrispyles Oct 23, 2022
877712e
working on fixing github action
chrispyles Oct 23, 2022
6825ecc
updated command
chrispyles Oct 23, 2022
cc11788
fixing build
chrispyles Oct 23, 2022
2727478
fixing build
chrispyles Oct 23, 2022
8acd100
fixing build
chrispyles Oct 23, 2022
4215053
working on fixing build
chrispyles Oct 23, 2022
01d4910
working on fixing build
chrispyles Oct 23, 2022
5962dd7
working on fixing build
chrispyles Oct 23, 2022
dc1ef4d
debugging build
chrispyles Oct 23, 2022
a7804db
debugging build
chrispyles Oct 23, 2022
7fe6f53
debugging build
chrispyles Oct 23, 2022
bdbacd7
debugging build
chrispyles Oct 23, 2022
08f097b
debugging build
chrispyles Oct 23, 2022
fb9029f
debugging build
chrispyles Oct 23, 2022
6315821
debugging build
chrispyles Oct 23, 2022
c20151c
debugging build
chrispyles Oct 23, 2022
168de1a
debugging build
chrispyles Oct 23, 2022
edaccb2
debugging build
chrispyles Oct 23, 2022
86a3163
debugging build
chrispyles Oct 23, 2022
d2c1e69
cleanup
chrispyles Oct 23, 2022
8ef2b41
updated docs
chrispyles Oct 23, 2022
1e38604
fixed ottr install url
chrispyles Oct 23, 2022
455a08f
fixed template
chrispyles Oct 23, 2022
a52a307
changelog
chrispyles Oct 23, 2022
5cddd0a
cleanup
chrispyles Oct 23, 2022
377d52a
Merge pull request #569 from chrispyles/remove-docker
chrispyles Oct 23, 2022
a458328
Merge branch 'master' into beta
chrispyles Oct 23, 2022
03ee761
merge updates from beta
chrispyles Oct 23, 2022
83aca43
fixed tests
chrispyles Oct 23, 2022
fd45939
working on integration test
chrispyles Oct 24, 2022
1100d39
Merge branch 'more-tests' into exec-preprocessor
chrispyles Oct 24, 2022
f269a95
working on integration tests
chrispyles Oct 28, 2022
1c48521
removed integration test
chrispyles Oct 29, 2022
e7521a5
add gcc to environment.yml
chrispyles Oct 29, 2022
2d0c72c
removing statsmodels
chrispyles Oct 29, 2022
a9017f5
cleanup
chrispyles Oct 29, 2022
315eb73
fixing test files
chrispyles Oct 29, 2022
f8818ad
add PYTESTOPTS
chrispyles Oct 29, 2022
d2d945f
prevent python 3.11 from being used
chrispyles Oct 29, 2022
ed4cfbc
Merge pull request #566 from chrispyles/more-tests
chrispyles Oct 30, 2022
d5c8689
merge updates from master
chrispyles Oct 30, 2022
e645a6a
merge updates from master
chrispyles Nov 6, 2022
07653b3
merge updates from master
chrispyles Dec 17, 2022
7f1985f
fix tests
chrispyles Dec 17, 2022
a50fc40
started conversion to exec preprocessor
chrispyles Feb 4, 2023
29a62b6
replace sklearn with scikit-learn
chrispyles Feb 11, 2023
2dfdfd9
test fixes
chrispyles Feb 15, 2023
38f0ace
Merge branch 'exec-preprocessor' of https://github.com/chrispyles/ott…
chrispyles Feb 15, 2023
34b79b1
removed file
chrispyles Feb 15, 2023
a2af1dc
restored tests
chrispyles Feb 15, 2023
0f62c6f
fixed bug in test ordering
chrispyles Feb 15, 2023
9b81564
added tests
chrispyles Feb 26, 2023
b35a719
changelog
chrispyles Feb 26, 2023
b57bb8f
some cleanup
chrispyles Feb 26, 2023
8878f4c
checker tests
chrispyles Mar 5, 2023
13bfa5e
add seek
chrispyles Mar 5, 2023
ecd5d9e
adding debugging
chrispyles Mar 5, 2023
b7344c3
debugging
chrispyles Apr 8, 2023
fc177c4
debugging
chrispyles Apr 8, 2023
6f48e71
make xecjk opt-in behavior
chrispyles Apr 8, 2023
0c48cfa
changelog
chrispyles Apr 8, 2023
41e4011
convert from PyPDF2 to pypdf
chrispyles Apr 8, 2023
2c2854c
yet more debugging
chrispyles Apr 8, 2023
5e018d9
add ability to upload blank pdf on export failure
chrispyles Apr 8, 2023
3e5cfae
Merge pull request #624 from chrispyles/xecjk-opt-in
chrispyles Apr 8, 2023
ae2600c
add pypdf to conda env on gs
chrispyles Apr 8, 2023
48d5c64
install otter package in conda env for testing
chrispyles Apr 8, 2023
d95893e
trigger github actions
chrispyles Apr 8, 2023
d60e8b6
Merge branch 'beta' into exec-preprocessor
chrispyles Apr 8, 2023
461ec0f
clean up debugging stuff
chrispyles Apr 8, 2023
69cd123
changelog
chrispyles Apr 8, 2023
e2bb92a
Merge branch 'beta' into staring-at-the-blank-page-before-you
chrispyles Apr 8, 2023
3b5a721
fix tests
chrispyles Apr 8, 2023
c526a21
Merge branch 'staring-at-the-blank-page-before-you' of https://github…
chrispyles Apr 8, 2023
87f689f
Merge pull request #626 from chrispyles/staring-at-the-blank-page-bef…
chrispyles Apr 9, 2023
a83a477
merge updates from beta
chrispyles Apr 9, 2023
f6c662a
add tests for Checker
chrispyles Apr 9, 2023
cdd752b
remove unnecessary whitespace
chrispyles Apr 9, 2023
43a755c
Merge pull request #610 from chrispyles/exec-preprocessor
chrispyles Apr 9, 2023
b60e451
enabled Otter Generate for all assignments using otter assign
chrispyles Apr 9, 2023
fc72ed3
use otter.api.grade_submission to run tests in Otter Assign
chrispyles Apr 9, 2023
c01a16c
fixes, cleanup
chrispyles Apr 9, 2023
a3bdeec
fix bug in adding seeds to cells in GradingPreprocessor
chrispyles Apr 9, 2023
b3475c0
changelog
chrispyles Apr 9, 2023
2b74555
fixed tests
chrispyles Apr 16, 2023
62b9432
merge updates from master
chrispyles Apr 16, 2023
0a2dc98
Merge branch 'beta' into r-tests-assign
chrispyles Apr 16, 2023
a50d0f0
Merge pull request #629 from chrispyles/r-tests-assign
chrispyles Apr 16, 2023
bcc156a
allow md cells to be used for delim cells
chrispyles Jun 26, 2023
cbe9ed6
changelog
chrispyles Jun 26, 2023
d2378ad
merge updates from release of v4.4.0
chrispyles Jul 6, 2023
f74488c
update release.py and update versions in new files
chrispyles Jul 6, 2023
d47c136
cleanup from merge
chrispyles Jul 6, 2023
7f3f2d8
fixed cleanup of test
chrispyles Jul 6, 2023
a47fb43
ensure that notebooks executed in tests import otter from the same place
chrispyles Jul 6, 2023
443b492
install build-essential
chrispyles Jul 6, 2023
4a6a3bb
Merge branch 'debugging-beta-builds' into fix-592-beta
chrispyles Jul 6, 2023
ede8a42
Merge pull request #651 from chrispyles/fix-592-beta
chrispyles Jul 7, 2023
ee758d6
tried fixing repo URL
chrispyles Jul 7, 2023
6d7d48b
Merge pull request #656 from chrispyles/debugging-beta-builds
chrispyles Jul 7, 2023
002c806
add config overrides to otter grade
chrispyles Jul 16, 2023
e2c25be
remove Docker platform specification
chrispyles Jul 16, 2023
1834c90
changelog
chrispyles Jul 16, 2023
a14b5cd
added tests for CLI overrides
chrispyles Jul 16, 2023
5edec92
normalize notebook before write
chrispyles Jul 16, 2023
b72aac6
changelog
chrispyles Jul 16, 2023
ac390ba
added summary to otter assign
chrispyles Jul 16, 2023
0289dce
only add seeds to code cells
chrispyles Jul 16, 2023
f70136b
handle versions of nbformat without normalize
chrispyles Jul 16, 2023
dc1ba79
fix test_single_notebook_grade
chrispyles Jul 16, 2023
c13ef77
Merge pull request #661 from chrispyles/config-overrides
chrispyles Jul 16, 2023
52a7ea1
Merge pull request #663 from chrispyles/assign-weirdness
chrispyles Jul 16, 2023
08a0992
add parens
chrispyles Jul 16, 2023
cc0e80d
Merge branch 'beta' into normalize
chrispyles Jul 16, 2023
36ee24c
Merge branch 'beta' into assign-summary
chrispyles Jul 16, 2023
3236089
changelog
chrispyles Jul 16, 2023
4b7165d
Merge pull request #662 from chrispyles/normalize
chrispyles Jul 16, 2023
97e65b5
convert to mamba
chrispyles Jul 16, 2023
14aeee8
update tests
chrispyles Jul 16, 2023
acd8d13
updated CI
chrispyles Jul 16, 2023
4103605
mark config override test as slow
chrispyles Jul 16, 2023
2ebfb5c
handle question points dict
chrispyles Jul 16, 2023
9fae880
Merge branch 'beta' into assign-summary
chrispyles Jul 16, 2023
1ef42a8
source conda.sh
chrispyles Jul 16, 2023
62ceab1
Merge pull request #664 from chrispyles/assign-summary
chrispyles Jul 16, 2023
fcd9f53
Merge branch 'beta' into mamba
chrispyles Jul 16, 2023
656393b
changelog
chrispyles Jul 16, 2023
53ec120
update dockerfile
chrispyles Jul 16, 2023
6619fba
update dockerfile
chrispyles Jul 16, 2023
753b879
fix tests
chrispyles Jul 16, 2023
3585c16
update static files
chrispyles Jul 16, 2023
360359c
update docs for v5
chrispyles Jul 16, 2023
08a1052
Merge pull request #665 from chrispyles/mamba
chrispyles Jul 16, 2023
191d232
Merge branch 'beta' into beta-docs
chrispyles Jul 16, 2023
d7a75b9
Merge pull request #666 from chrispyles/beta-docs
chrispyles Jul 16, 2023
5f9cc4f
change from default python 3.7 to 3.9
chrispyles Jul 16, 2023
b4041d0
Merge branch 'beta' into default-python
chrispyles Jul 16, 2023
72555ea
Merge pull request #667 from chrispyles/default-python
chrispyles Jul 16, 2023
abffb95
Merge branch 'master' into beta
chrispyles Jul 16, 2023
8dbccac
update version numbers
chrispyles Jul 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ omit =

# This file is a copy of an external script and is not tested as part of Otter
otter/plugins/builtin/gmail_notifications/bin/gmail_oauth2.py

# The Assign v0 format is deprecated and will be removed in v5
otter/assign/v0/*
46 changes: 0 additions & 46 deletions .github/workflows/docker-build.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:

env:
TAR: /bin/tar
DOCKER_BUILDKIT: 1

steps:
- name: Set up Python 3.8
Expand All @@ -29,20 +28,6 @@ jobs:

- uses: actions/checkout@v2

- uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v1

- name: Install dependencies
run: |
python3 -m pip install -r requirements.txt twine wheel setuptools
Expand Down Expand Up @@ -94,14 +79,3 @@ jobs:
run: |
hub pull-request -b ucbds-infra:master -h ucbds-infra:stable -l "release" -r chrispyles \
-m "Release v${{ github.event.inputs.version }}"$'\n'$'\n'"Updates from the release of version ${{ github.event.inputs.version }}"

- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ucbdsinfra/otter-grader:v${{ github.event.inputs.version }}
ucbdsinfra/otter-grader:latest
cache-from: type=gha
cache-to: type=gha,mode=max
18 changes: 6 additions & 12 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,24 @@ jobs:

env:
TAR: /bin/tar
DOCKER_BUILDKIT: 1
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled

steps:
- uses: actions/checkout@v2

- uses: docker/setup-buildx-action@v1
id: buildx
- uses: docker/setup-buildx-action@v2
with:
install: true

- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v1

- name: Prepare for Docker image build
run: |
make docker-test-prepare

- name: Build Docker image
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: test-Dockerfile
load: true
push: false
tags: otter-test
Expand All @@ -51,11 +46,10 @@ jobs:
build-args: |
DOCKER_VERSION=20.10.24

- name: Clean up Docker image build
run: make docker-ci-test-cleanup

- name: Run tests
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp otter-test bash -c "cd /home/otter-grader; pip install -r requirements-test.txt -r requirements-export.txt; make testcov && coverage xml -i && cp ./coverage.xml /tmp/coverage.xml" && cp /tmp/coverage.xml ./coverage.xml
run: |
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp otter-test /root/otter-grader/bin/run_tests
cp /tmp/coverage.xml ./coverage.xml

- uses: codecov/codecov-action@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gs-testing-stuff
.OTTER_LOG
docs/tutorial/dist
docs/_static/notebooks/html
arm-Dockerfile
htmlcov/
.pytest_cache/
/sync.sh
8 changes: 0 additions & 8 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ version: 2
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7

conda:
environment: rtd_environment.yml
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

**Unreleased (beta):**

* Converted all dependency management in the autograder configuration zip file to Conda per [#501](https://github.com/ucbds-infra/otter-grader/issues/501)
* Removed deprecated Otter Assign format v0
* Disabled editing for question prompt cells in the notebooks generated by Otter Assign per [#431](https://github.com/ucbds-infra/otter-grader/issues/431)
* Removed `ucbdsinfra/otter-grader` Docker image and made default image for Otter Grade `ubuntu:22.04` per [#534](https://github.com/ucbds-infra/otter-grader/issues/534)
* Make `xeCJK` opt-in behavior for exporting notebooks via LaTeX per [#548](https://github.com/ucbds-infra/otter-grader/issues/548)
* Convert from use of deprecated `PyPDF2` package to `pypdf`
* Add configuration to submit blank PDF to manual-grading Gradescope assignment if PDF generation fails per [#551](https://github.com/ucbds-infra/otter-grader/issues/551)
* Removed the `after_execution` event from the plugin lifecycle
* Updated execution internals to use `nbconvert.preprocessors.ExecutePreprocessor` instead of the `exec` function to execute submissions per [#604](https://github.com/ucbds-infra/otter-grader/issues/604)
* Deprecated the `variables` key of the assignment config in favor of `generate.serialized_variables`
* Enabled Otter Generate for all assignments created with Otter Assign
* Updated Otter Assign to use Otter Run to validate that all tests in the assignment pass, allowing tests to be run for R assignments as well as Python, per [#427](https://github.com/ucbds-infra/otter-grader/issues/427)
* Allow Markdown cells to be used instead of raw cells for Otter Assign per [#592](https://github.com/ucbds-infra/otter-grader/issues/592)
* Use Otter Grade CLI flags to update `otter_config.json` values in the grading container per [#395](https://github.com/ucbds-infra/otter-grader/issues/395)
* Removed `linux/amd64` platform specification for Docker images in Otter Grade
* Updated Otter Assign to normalize notebooks before writing them with `nbformat.validator.normalize` per [#658](https://github.com/ucbds-infra/otter-grader/issues/658)
* Added summary of assignment questions to Otter Assign logging per [#564](https://github.com/ucbds-infra/otter-grader/issues/564)
* Converted to Mamba from Conda for package management in grading containers per [#660](https://github.com/ucbds-infra/otter-grader/issues/660)
* Upgraded default Python version in grading containers from 3.7 to 3.9

**v4.4.1:**

* Update Otter Grade to close file handles before copying files out of Docker containers to fix bug on Windows
Expand Down
27 changes: 0 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,6 @@ make testcov
```


### Test Docker Images

To build a Docker image suitable for testing, use the Makefile target `docker-test`. This will
build a Docker image tagged `otter-test` which includes the development version of Otter in your
local copy of the repo as the installed version of Otter.

```
make docker-test
```

If you need to build testing images for grading assignments, use the `docker-grade-test` target to
edit the Dockerfile in `otter/grade` and then install your local copy of the rpeo:

```
make docker-grade-test
pip install .
```

**Do not commit any changes made by this Makefile target.**

Once you finish, make sure to run the `cleanup-docker-grade-test` target to undo your changes.

```
make cleanup-docker-grade-test
```


## Building the Documentation

To build a local copy of the documentation, use the `docs` target of the Makefile.
Expand Down
89 changes: 33 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
# Dockerfile forked from https://github.com/jeffheaton/docker-jupyter-python-r/blob/master/Dockerfile
FROM ubuntu:20.04

# common packages
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y tzdata git vim wget libssl-dev nano && \
rm -rf /var/lib/apt/lists/*

# miniconda
RUN echo 'export PATH=/opt/conda/bin:$PATH' >> /root/.bashrc && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
rm -rf /var/lib/apt/lists/*

ENV PATH /opt/conda/bin:$PATH

# R pre-reqs
RUN apt-get clean && \
apt-get update && \
apt-get install -y --no-install-recommends fonts-dejavu gfortran gcc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# R
RUN apt-get clean && \
apt-get update && \
conda install -y "r-base>=4.0.0" r-essentials && \
conda install -c r r-irkernel r-essentials r-devtools -c conda-forge && \
rm -rf /var/lib/apt/lists/*

# install wkhtmltopdf for otter export
RUN apt-get clean && \
apt-get update && \
apt-get install -y pandoc && \
apt-get install -y -f texlive-xetex texlive-fonts-recommended texlive-lang-chinese && \
wget --quiet -O /tmp/wkhtmltopdf.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb && \
apt-get install -y /tmp/wkhtmltopdf.deb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set the locale to UTF-8 to ensure that Unicode output is encoded correctly
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# create dir for autograder
RUN mkdir /autograder

# Python requirements
ADD requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

RUN pip install otter-grader==4.4.1
RUN Rscript -e "install.packages('ottr', dependencies=TRUE, repos='http://cran.us.r-project.org')"
# Docker image for setting up a development environment and Otter's automated tests.

FROM docker/buildx-bin as buildx

FROM ubuntu:latest

# Make docker buildx available in the container
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx

# Install apt packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y wget make build-essential

# Install mamba
RUN if [ $(uname -p) = "arm" ] || [ $(uname -p) = "aarch64" ] ; \
then wget -nv https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-aarch64.sh \
-O /tmp/mamba_install.sh ; \
else wget -nv https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh \
-O /tmp/mamba_install.sh ; \
fi && \
chmod +x /tmp/mamba_install.sh && \
/tmp/mamba_install.sh -b
ENV PATH=/root/mambaforge/bin:$PATH

# Create mamba environment
COPY environment.yml requirements.txt requirements-export.txt requirements-test.txt /tmp/
RUN mkdir -p /tmp/docs && touch /tmp/docs/requirements.txt
RUN mamba env create -f /tmp/environment.yml
RUN mamba run -n otter-grader Rscript -e 'install.packages("ottr", dependencies=TRUE, repos="https://cran.r-project.org")'
ADD . /root/otter-grader
RUN mamba run -n otter-grader pip install /root/otter-grader

# Make script executable
RUN chmod +x /root/otter-grader/bin/run_tests
38 changes: 0 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ PYTESTOPTS = -v
COVERAGE = coverage
DOCKER = true
SLOW = true
OS := $(shell uname -s)

ifeq ($(DOCKER), false)
PYTESTOPTS := $(PYTESTOPTS) -m "not docker"
Expand All @@ -28,45 +27,8 @@ htmlcov: testcov
docs:
$(MAKE) -C docs html

docker-test-prepare:
cp -r Dockerfile test-Dockerfile
printf "\nADD . /home/otter-grader\nRUN pip install /home/otter-grader" >> test-Dockerfile
printf "\nARG DOCKER_VERSION" >> test-Dockerfile
printf "\nRUN cd /tmp && curl -sSL -O https://download.docker.com/linux/static/stable/x86_64/docker-$$%s.tgz && tar zxf docker-$$%s.tgz && mv ./docker/docker /usr/local/bin && chmod +x /usr/local/bin/docker && rm -rf /tmp/*" "{DOCKER_VERSION}" "{DOCKER_VERSION}" >> test-Dockerfile
printf "\nCOPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx" >> test-Dockerfile
printf "\nENV PYTHONUNBUFFERED 1" >> test-Dockerfile

docker-test: docker-test-prepare
docker build . -t otter-test -f test-Dockerfile --cache-from ucbdsinfra/otter-grader:latest
rm test-Dockerfile

docker-ci-test-cleanup:
rm test-Dockerfile

tutorial:
cd docs/tutorial; \
zip -r tutorial.zip submissions demo.ipynb requirements.txt -x "*.DS_Store"; \
cp tutorial.zip ../_static; \
rm tutorial.zip

docker-grade-test:
cp otter/generate/templates/python/setup.sh otter/generate/templates/python/old-setup.sh
printf "\nconda run -n otter-env pip install /home/otter-grader" >> otter/generate/templates/python/setup.sh
ifeq ($(OS), Darwin)
sed -i '' -e "s+ucbdsinfra/otter-grader+otter-test+" otter/generate/templates/python/setup.sh
sed -i '' -e "s+ucbdsinfra/otter-grader+otter-test+" otter/generate/templates/python/run_autograder
else
sed -i "s+ucbdsinfra/otter-grader+otter-test+" otter/generate/templates/python/setup.sh
sed -i "s+ucbdsinfra/otter-grader+otter-test+" otter/generate/templates/python/run_autograder
endif

cleanup-docker-grade-test:
rm otter/generate/templates/python/setup.sh
mv otter/generate/templates/python/old-setup.sh otter/generate/templates/python/setup.sh
ifeq ($(OS), Darwin)
sed -i '' -e "s+otter-test+ucbdsinfra/otter-grader+" otter/generate/templates/python/setup.sh
sed -i '' -e "s+otter-test+ucbdsinfra/otter-grader+" otter/generate/templates/python/run_autograder
else
sed -i "s+otter-test+ucbdsinfra/otter-grader+" otter/generate/templates/python/setup.sh
sed -i "s+otter-test+ucbdsinfra/otter-grader+" otter/generate/templates/python/run_autograder
endif
11 changes: 11 additions & 0 deletions bin/run_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Runs Otter's tests and copies the resulting coverage.xml file into the /tmp directory. This script
# should only be used inside a Docker container created by /Dockerfile.

export PATH="/root/mambaforge/bin:$PATH"
source /root/mambaforge/etc/profile.d/conda.sh
source /root/mambaforge/etc/profile.d/mamba.sh
cd /root/otter-grader
mamba activate otter-grader
make testcov PYTESTOPTS="-vv" && coverage xml -i && cp ./coverage.xml /tmp/coverage.xml
Loading
Loading