Skip to content

Commit

Permalink
Merge development into master (#862)
Browse files Browse the repository at this point in the history
* trying to find where the avatar admin display is breaking (#851)

* trying to find where it's breaking

* restart codeclimate - blank commit

* Setup Versioning (#849)

* test version 0.1.0

* Merge branch 'master' into versions

* try wihtout multiple deployment provider setup

* Remove if

* add job name to deploy stage

* Github versioning with releases

* Merge branch 'master' into versions

* test deploy step

* remove file option

* Make sure travis releases are prereleases

* Test deploy to PyPi

* specify branch for PyPi

* again

* only run deploy step once

* Merge branch 'master' into versions

* Merge branch 'development' into versions

* test release stage

* replace before_deploy with script

* remove extra indentation

* close second if statement

* Make bash script more resilient

* fix bash script syntax error

* Try using export

(commentted out python tests to make travis build faster for testing)

* Comment out job name

* comment out the whole test job

* move tag script into it’s own file

* test duplicate providers with different branch conditions

* test PyPi deploy with tags: true

* try bash script condition for PyPi

* fix bash script error

* Test deploy on tags

* try seeing if setting Travis tag gives use the corrent pypi number

* fix bash export statement

* push git tag before release

* Target correct commit on github releases

* bump up version number

* get ready for PR, switch branch from versions to development

* Update contributing guidelines

* Update versioning pipeline details

* Merge development into versions

* C-001 solution (#848)

* get docker for mac working

change ingresses namespace

change get_game_url_base_path

use docker for desktop ip

* begun creation of roles

* C-001 fixed

Attempted to replicate the security flaw C-001 as per the test report after implementing RBAC. The console shows a 503 upon attempting to replicate the issue, the user's consoles shows a 111 (connection refused). This leads to the conclusion the the issue has been resolved, however further testing may be needed.

* Moved role/account yamls to their own folder

Put them all in an rbac folder to keep the in one easy to find place

* Added a comment to describe the process

added a string to describe how to set up docker-desktop with extensions, and make use of RBAC. These steps may need to be automated, or included in the setup process. Minor issues still exist however.

* added reference to source of information

just so other's can find it easily if needed.

* Update worker account

* updated game_creator_role and minor changes

moved the game creator to the nginx namespace and updated it's role to reflect this, the ClusterRoleBinding gives the permissions of the game creator's permissions scope of the whole cluster (hence why it was moved out of reach of the worker pods, just incase there is a way for workers to gain access outside of their pod)

* Fixed game creator rc yaml not applying role binding

* change role binding namespace

* updated version

* Delete nginx-ingress folder

* Revert "get docker for mac working"

This reverts commit 017620a.

# Conflicts:
#	aimmo_runner/minikube.py

* Automate applying the accounts and roles

* fix travis build fail attempt

* Testing build fail

* More travis build tests

* travis build fix attempt++

* Update travis kubernetes version

* change kubernetes to ealier patch version

Kubernetes needs to be version 1.9.4 not 1.9.6

* Tests

* various changes

* Merge branch 'development' into c-001

* Resolve merge conflicts

* Merge remote-tracking branch 'origin/c-001' into c-001

* Fix issues created from merge conflicts

* Replacing versioner in setup.py

* minor change

* change to restart code climate

* pep8

* Docker for local mode (#859)

* Reduce image sizes for docker images

* bump version

* Stop turn slowdown (#857)

* Identified a potential point of slowdown

Turn processing is already done concurrently, but data fetching for all the workers was not, so i have changed this in the hopes it will speed up turn times and the number of users increases.

* Rethinking approach

difficult to implement concurrent solution to the code in question, rethinking approach.

* Added comments to where things need changing

added a couple of comments to explain what need's to be done in various places that i've identified that could slow down turns.

* Turn times had been sped up

Solution has been to create a timed process populated with daemon threads, this forces the main source of the slowdown into a 2 second window. However this has highlighted a big issue, the requests take more than 2 seconds a significant proportion of the time and as a result many actions become wait actions, also there needs to be a degree of garbage collection to prevent the creation of a potentially server ending amount of processes

* Cleanup

game runs turns at consistent 3 seconds locally even with 10 people, which in the past seem to cause the game to crash. Avatars seem to be able to respond in the 2 second limit, however we may want to increase this duration to make it more reliable.

* Merge branch 'development' into stop_turn_slowdown

* update version

* Minor changes

* Grammar changes

* reviewable changes

* Bump version number

* Reviewable changes++

* Merge branch 'development' into stop_turn_slowdown

* pep8

* Merge remote-tracking branch 'origin/stop_turn_slowdown' into stop_turn_slowdown

* Merge master into development (#861)

* Update minikube status check (#846)

* Update logic to check whether minikube is already running.

* Updated except to check for CalledProcessError.

* Merge branch 'master' into minikube-run-start

* Merge branch 'master' into development
  • Loading branch information
TheseusGrey committed Oct 17, 2018
1 parent 408a1f6 commit d78e5d2
Show file tree
Hide file tree
Showing 20 changed files with 1,542 additions and 173 deletions.
139 changes: 82 additions & 57 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,94 @@ git:
depth: 9999999 # Building untagged builds needs enough depth to get the latest tag
stages:
- name: test
- name: release
if: branch = master OR branch = development
- name: deploy
if: branch = master
if: tag IS present
jobs:
include:
- stage: test
name: "Python Tests"
env:
- NODE_ENV=production
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.7.0
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
before_install:
- nvm install node
- nvm use node
- gem install sass --version 3.3.4
install:
- pip install .
- pip install coveralls
- pushd game_frontend
- yarn
- node djangoBundler.js
- popd
script:
- python all_tests.py --coverage
after_success:
- coveralls
- name: "Javascript Tests"
before_install:
- nvm install node
- nvm use node
install:
- cd game_frontend && yarn
script:
- yarn test
- stage: deploy
env:
- NODE_ENV=production
before_install:
- nvm install node
- nvm use node
install:
- pushd game_frontend
- yarn
- popd
script:
- pushd game_frontend
- node djangoBundler.js
- popd
deploy:
include:
- stage: test
name: "Python Tests"
env:
- NODE_ENV=production
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.9.4
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
before_install:
- nvm install node
- nvm use node
- gem install sass --version 3.3.4
install:
- pip install .
- pip install coveralls
- pushd game_frontend
- yarn
- node djangoBundler.js
- popd
script:
- python all_tests.py --coverage
after_success:
- coveralls
- name: "Javascript Tests"
before_install:
- nvm install node
- nvm use node
install:
- cd game_frontend && yarn
script:
- yarn test
- stage: release
script:
- bash tag_release_on_travis.sh
deploy:
- provider: releases
api_key:
secure: "dZxjTMW1+eAIw4gv71PKpaaL62BNcb2uWRf4ft1mVRRwsdNy5M1Vxv3YvOQGEYUO3TAo2xuvj/ifc1Yp6F1nCU7fLQaHllUljzU/Wa7gebv434TXMKfCbYLCFAylALF1Up0xhdaJaIEpEK9V4VqGeqhWcvAxi+fuFeK7CNgkvgxMINGAF96m3uU5CRKk4oU45ETifvFoWE8Kea73H32uisShqiECIsririOWZLKnm2YeGn3z26kKNjkn8wK4upWESCZUfP46FjFzV3EtT8RE51g6LFToaIls7fs99yLCwkX4xWBRdI0b6c5JvuaP4mukaXc6Ud9nREVmuOVsJ8mJbtnfl9hvfCdnzSpWR4x1ep6EinmPEX4Z1eBoeYXMkU31eOgdzXn+VpyT48W1rcrZxNCGe9Ln09OLlgNx5aYMDNAKrXiYkD55aMLFM7JLmX40DSez7EP8FFM5xALtNQnwun4ziGomf8Hl8GroYC+xNYIDMSpXVQBEc8s04dw3267tIPbA1p63CAHL/edAzn6bTtmvjLOI49o1fMLHls9ECW4/dKhalsPuZ4GUwqwIbf0WvTzNyvKjx65O+stDkxisDbVWVbXXNzGmbvvKJBo8SRymTM/THpavi+keps3kjUfmfmhImayG5fj5Z9G4r3KM77K+siQTvjjjg0t2hbLvyWI="
prerelease: true
target_commitish: development
skip_cleanup: true
on:
repo: ocadotechnology/aimmo
branch: development
- provider: releases
api_key:
secure: "dZxjTMW1+eAIw4gv71PKpaaL62BNcb2uWRf4ft1mVRRwsdNy5M1Vxv3YvOQGEYUO3TAo2xuvj/ifc1Yp6F1nCU7fLQaHllUljzU/Wa7gebv434TXMKfCbYLCFAylALF1Up0xhdaJaIEpEK9V4VqGeqhWcvAxi+fuFeK7CNgkvgxMINGAF96m3uU5CRKk4oU45ETifvFoWE8Kea73H32uisShqiECIsririOWZLKnm2YeGn3z26kKNjkn8wK4upWESCZUfP46FjFzV3EtT8RE51g6LFToaIls7fs99yLCwkX4xWBRdI0b6c5JvuaP4mukaXc6Ud9nREVmuOVsJ8mJbtnfl9hvfCdnzSpWR4x1ep6EinmPEX4Z1eBoeYXMkU31eOgdzXn+VpyT48W1rcrZxNCGe9Ln09OLlgNx5aYMDNAKrXiYkD55aMLFM7JLmX40DSez7EP8FFM5xALtNQnwun4ziGomf8Hl8GroYC+xNYIDMSpXVQBEc8s04dw3267tIPbA1p63CAHL/edAzn6bTtmvjLOI49o1fMLHls9ECW4/dKhalsPuZ4GUwqwIbf0WvTzNyvKjx65O+stDkxisDbVWVbXXNzGmbvvKJBo8SRymTM/THpavi+keps3kjUfmfmhImayG5fj5Z9G4r3KM77K+siQTvjjjg0t2hbLvyWI="
prerelease: false
target_commitish: master
skip_cleanup: true
on:
repo: ocadotechnology/aimmo
branch: master
- stage: deploy
env:
- NODE_ENV=production
before_install:
- nvm install node
- nvm use node
install:
- pushd game_frontend
- yarn
- popd
script:
- pushd game_frontend
- node djangoBundler.js
- popd
deploy:
- provider: pypi
skip_cleanup: true
provider: pypi
user: ocadotechnology
password:
secure: "dX2M4PpyGwa1bjpJN/Wk3EORWRXuTS14ZQEQ7Ndqk/WnOZlNqD5t/WiITTdqBWoR/ScvQiGBzR/VdRLZllkGrhupoMrtkfCldaxEI3/wbbwW9CiLuwyR/V5xgVj9TA+PtXErjgAqG9KRtyaBEOaC20t13Uc6vuIc9e6aXkzhQ9hf3vVMlnABOZP3f/2R3+sJQMLylGPCz/6BAs2U+nyxGJCpfq0aJK7H2aVPUKtM1/nscuhvsrl8yU+RWYS3idgfXDuPlwqKvRL9xbEm1DC3ByCFwwzAGCPlUtzYlx6Ttrg8Jv6S1cgsjxijzV5QqU+k1JhmY3jDqqmMROFAaY3wJ6038xUbn4zlgvXgtCayiebJukSMR7tJoVrs6ao26QPsbLNZdReDzSXJR05pgB4I8gGTlIKeZE8zOS75hkv0CdMjmIsQhTeMKqQcATuN8QszYRP4uO7vG+3I7hNSK8HcqxHtNLEDq2/QKDAVBve0R5CeEvLMnSxj7UydO+HuJUgickjHuJUmLZ+7iR9i1p6G0MUpKq/n8izSponvShu0lDshrNWJ9PYuhRD4Yvnp4/FCSxdY0+u7pHJsbluGcIvaAlwoa5O01Seu2pVpox8hVTIhn9LuR0wP7Ed4Nxper7cMNgugqb8J9BybSlMjRlBYmI7FQePCdsu1ETNI9JDHAug="
distributions: "bdist_wheel sdist"
on:
repo: ocadotechnology/aimmo
after_deploy:
- "curl -d POST -v https://semaphoreci.com/api/v1/projects/${SEMAPHORE_PROJECT_ID}/master/build?auth_token=${SEMAPHORE_API_AUTH}"
tags: true
after_deploy:
- "curl -d POST -v https://semaphoreci.com/api/v1/projects/${SEMAPHORE_PROJECT_ID}/master/build?auth_token=${SEMAPHORE_API_AUTH}"
21 changes: 14 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Clone your repo using HTTPS
* Work on a new git branch.
* Need help with [git](https://git-scm.com/docs/gittutorial)?
Anyway you can't use Ocado Technology's master.
* The [issues are listed on ocadotechnology/aimmo](https://github.com/ocadotechnology/aimmo/issues).
It's even better if you're using [ZenHub](https://www.zenhub.com/) because it will allow you to look at a [Kanban-ish board](https://github.com/ocadotechnology/aimmo/issues#boards) for the project.
The new starter / up-for-grabs issues are listed with the [help wanted label](https://github.com/ocadotechnology/aimmo/labels/help%20wanted)
Expand All @@ -18,13 +17,21 @@ The new starter / up-for-grabs issues are listed with the [help wanted label](ht
* To manually test things and run the project, `./run` in the root.

## Great, you can **commit**, open a **Pull Request**, and we'll **review** it...
* Then you can commit! On a new branch for a new Pull Request please.
* If your commit resolves a GitHub issue, please include “fixes #123” in the commit message.
* Then you can push to your forked repo, and create a pull request from your branch to ocadotechnology's master branch.
* Some tests will run automatically: Travis will run the automated tests, coverage will test the test coverage. Please fix found issues, then repush on your branch - it will rerun the tests.

Before you merge:
- Your PR should be connected to a corresponing ZenHub issue.
- All required status checks must pass.
- Add documentation if necessary

* Do not accept a PR yourself - at least someone else should review your code and approve it first.
* Some old PRs will need to see the branch rebased on the current master
* When a PR is accepted, **congrats!** It will be merged on master.

### When a PR is accepted

1. It will be merged into the development branch
2. A new beta version of AI:MMO will be released on PyPI and Docker Hub
3. The beta will be tested on our staging servers

Eventually, development will be merged into master. This will trigger a stable release which will make it's way up to production. Congrats! 🎉

## Some conventions to keep in mind...
We follow PEP8 convention quite strictly however we do make a few exceptions to this rule. They are as follows:
Expand Down
Loading

0 comments on commit d78e5d2

Please sign in to comment.