-
Notifications
You must be signed in to change notification settings - Fork 4
Dockerized Faculty Tools #22
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
Open
ssilverm
wants to merge
52
commits into
develop
Choose a base branch
from
issue/21-dockerize
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
cb65910
Dockerized Faculty Tools
ssilverm b0031a6
Removing settings.py.template
ssilverm ea97747
Fixes naming confusion
ssilverm c5bc16e
CI test
ssilverm 1a1532f
CI test
ssilverm 32300df
CI test
ssilverm 5dd2415
CI test
ssilverm 9c1cb3e
flake8
ssilverm 2601e5d
black
ssilverm 0721d34
CI/CD + black
ssilverm 3d1cee5
README MDL
ssilverm 98ee7b9
Trying with nginx and uwsgi files
ssilverm a5d3d5f
README
ssilverm 71e6278
README
ssilverm 2ec1f22
Load ENV?
ssilverm 58952fd
.env
ssilverm 8d8cf31
Fixing status test
ssilverm 0851770
Key / Secret env template
ssilverm d916489
Better dockeriziation
ssilverm db4b2d4
Fixed linting
ssilverm 30b4620
testing github docker image push
ssilverm 9c523bb
req + on needs
ssilverm 1b56e91
CICD
ssilverm 5c8096a
cicd
ssilverm 912864c
requirements?
ssilverm 52da810
Env?
ssilverm 10629f9
Env?
ssilverm aaef398
Env?
ssilverm b4902aa
build args
ssilverm d87cfa6
adding git hash to ci
ssilverm 4af0af2
sha
ssilverm e3e1865
sha
ssilverm f7750fe
sha
ssilverm 11ae104
sha
ssilverm b6ecd9f
sha
ssilverm 3c3f49d
using tags based on branch
ssilverm e39ee49
Log handler
ssilverm be52aeb
flake8 linting
ssilverm fa30299
changed env to remove https for demo
ssilverm 6c2fd0c
Passing tests
ssilverm 6d80d5d
Tests passing
ssilverm 06d3a24
Fixed formatting
ssilverm 6dc0cd3
First fixes
ssilverm 8fd80ee
Linted
ssilverm e60651b
MDL
ssilverm dcd0c27
config comment change
ssilverm af2863a
Testing ARM
ssilverm cd8784d
Testing ARM platforms
ssilverm e43eb0f
Testing ARM platforms
ssilverm 6649bed
Testing ARM platforms
ssilverm ef62752
Testing ARM platforms
ssilverm b2f2f11
Testing ARM platforms
ssilverm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
.dockerignore | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
env | ||
venv* | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
.tox | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
*.log | ||
.git | ||
*.template | ||
.env* | ||
fake-s3 |
This file contains hidden or 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,16 @@ | ||
TOOL_TITLE=Faculty Tools | ||
THEME_DIR= | ||
BASE_CANVAS_SERVER_URL=https://example.com/ | ||
SECRET_KEY=CHANGEME | ||
LTI_KEY=key | ||
LTI_SECRET=secret | ||
OAUTH2_URI=http://127.0.0.1:9001/oauthlogin | ||
OAUTH2_ID=CHANGEME | ||
OAUTH2_KEY=CHANGEME | ||
GOOGLE_ANALYTICS=GA-000000 | ||
CONFIG=config.DevelopmentConfig | ||
DATABASE_URI=mysql://root:secret@db/faculty_tools | ||
|
||
REQUIREMENTS=test_requirements.txt | ||
|
||
WHITELIST_JSON=whitelist.json |
This file contains hidden or 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,96 @@ | ||
name: Run Python Tests and Build Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- issue/21-dockerize | ||
- develop | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
REQUIREMENTS: requirements.txt | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Python 3 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r test_requirements.txt | ||
pip install coveralls | ||
- name: Setup Repo | ||
run: | | ||
cp whitelist.json.template whitelist.json | ||
cp .env.template .env | ||
- name: Run flake8 | ||
run: flake8 | ||
- name: Run black | ||
run: black --check . | ||
- name: Lint markdown files | ||
uses: bewuethr/mdl-action@v1 | ||
# - name: Load dotenv | ||
# uses: falti/dotenv-action@v0.2.5 | ||
- name: Environment Variables from Dotenv | ||
uses: c-py/action-dotenv-to-setenv@v3 | ||
# - name: Print Repo | ||
# run: | | ||
# env | ||
- name: Run unittests | ||
run: coverage run -m unittest discover | ||
|
||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Print Buildx | ||
run: | | ||
docker buildx ls | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: REQUIREMENTS=${{ env.REQUIREMENTS }} | ||
platforms: linux/amd64 | ||
|
||
- name: Build and push ARM64 Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: REQUIREMENTS=${{ env.REQUIREMENTS }} | ||
platforms: linux/arm64 | ||
|
||
- name: Build and push ARMv7 Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: REQUIREMENTS=${{ env.REQUIREMENTS }} | ||
platforms: linux/arm/v7 | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# config/settings | ||
logs | ||
settings.py | ||
whitelist.json | ||
.env | ||
|
||
# local theming | ||
themes/* | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,9 @@ | ||
FROM python:3.7 as base | ||
ARG REQUIREMENTS | ||
COPY requirements.txt /app/ | ||
COPY test_requirements.txt /app/ | ||
RUN pip install -r /app/$REQUIREMENTS | ||
WORKDIR /app | ||
COPY ./ /app/ | ||
EXPOSE 9001 | ||
CMD ["gunicorn", "--conf", "gunicorn_conf.py", "--bind", "0.0.0.0:9001", "lti:app"] |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.