Skip to content

Commit

Permalink
fix: Move game creator to Django (#1798)
Browse files Browse the repository at this point in the history
* Move game creator logic to Django

* Merge master

* Merge master

* Finish merging conflicts

* Move serializers to models.py

* Fix tests

* Fix tests again

* Fix tests again again

* Clean pipfiles and dependencies

* Clean up, increase local fleet to 15 and reduce retry from 60 to 10

* Try adding back pytest as test package for ci

* Add back all dev packages to setup.py

* Test removing the patch method (not needed?)

* Clean tests

* Merge conflicts

* Try using prints instead of logger

* Remove final logger

* Replace views loggers with print

* Recreate game service on worksheet change

* Cleanup

* Feedback

* Delete unused endpoint

* Fix test

* Add URL log
  • Loading branch information
faucomte97 committed Oct 16, 2023
1 parent 2b71f0d commit 7c2fe3e
Show file tree
Hide file tree
Showing 61 changed files with 1,717 additions and 2,527 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,6 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

test-aimmo-game-creator:
name: Test aimmo-game-creator
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build docker image
run: |
cd aimmo-game-creator
docker build -t ocadotechnology/aimmo-game-creator:test --target tester .
- name: Run tests
run: docker run -i -p 5000:5000 ocadotechnology/aimmo-game-creator:test /bin/bash -c "coverage run setup.py test && coverage xml"
- name: Get the coverage data from the container
run: |
read CONTAINERID <<< $(docker ps --all -q | head -1)
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

test-aimmo-game-worker:
name: Test aimmo-game-worker
runs-on: ubuntu-20.04
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ jobs:
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push aimmo-game-creator image
id: game_creator
uses: docker/build-push-action@v3
with:
context: aimmo-game-creator
file: aimmo-game-creator/Dockerfile
tags: ocadotechnology/aimmo-game-creator:${{ steps.docker_tag.outputs.tag }}
target: runner
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: |
echo ${{ steps.game.outputs.digest }}
Expand Down
20 changes: 12 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ verify_ssl = true
name = "pypi"

[dev-packages]
black = "*"
codeforlife-portal = "*"
django-import-export = "*"
django-test-migrations = "==1.2.0"
pytest = "~=6.2"
pytest-cov = "*"
pytest-django = "==4.5.2"
pytest-pythonpath = "*"
codeforlife-portal = "*"
pytest-cov = "*"
black = "*"
django-test-migrations = "==1.2.0"
django-import-export = "*"

[packages]
aimmo = {editable = true, path = "."}
kubernetes = "==26.1.0"
eventlet = "*"
django-formtools = "==2.2"
django-otp = "==1.0.2"
docker = "<6"
wheel = "*"
eventlet = "*"
importlib-metadata = "<5" # Using version 5 causes an issue when trying to run pytest. Not sure why, linked to: https://stackoverflow.com/questions/73929564/entrypoints-object-has-no-attribute-get-digital-ocean
kubernetes = "==26.1.0"
pyyaml = "==5.4.1"
setuptools = "==62.1.0"
wheel = "*"

[requires]
python_version = "3.8"
Expand Down
520 changes: 326 additions & 194 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion agones/fleet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Fleet
metadata:
name: aimmo-game
spec:
replicas: 3
replicas: 15
strategy:
type: Recreate
template:
Expand Down
29 changes: 0 additions & 29 deletions aimmo-game-creator/.codecov.yml

This file was deleted.

17 changes: 0 additions & 17 deletions aimmo-game-creator/.coveragerc

This file was deleted.

2 changes: 0 additions & 2 deletions aimmo-game-creator/.dockerignore

This file was deleted.

19 changes: 0 additions & 19 deletions aimmo-game-creator/Dockerfile

This file was deleted.

18 changes: 0 additions & 18 deletions aimmo-game-creator/Pipfile

This file was deleted.

Loading

0 comments on commit 7c2fe3e

Please sign in to comment.