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

Add cloud capabilities to TNoodle-webscrambles #444

Merged
merged 32 commits into from
Dec 19, 2019

Conversation

gregorbg
Copy link
Member

@gregorbg gregorbg commented Nov 2, 2019

Introducing: GCloud

With this commit, TNoodle can be deployed to the Google App Engine!

In particular, please refer to the GCloud SDK docs for deployment instructions. You will have to install your own gcloud sdk package.

A proof of concept can be seen at https://wca-scrambles-unofficial.appspot.com/ 🎉

Code changes

Mostly adding the Google Application Engine plugin to Gradle. There are some changes in the way ktor boots, which fortunately makes the code a little easier in some parts. We are now using a stand-alone resource configurattion file instead of Java code configurations 🙃

The version information that was previously processed through the MANIFEST.mf file is now in a separate tnoodle.version resource file, because Google Cloud does not support manifests.

TNoodle server can now read blobs from Google Cloud Storage for pruning tables. Important resources like translations are still available from within the JAR

Other notes

TNoodle can still be compiled into a standalone JAR that launches like usual. The Google Cloud functionality is additional to the existing structure

My first PR under 1000 lines of code 😄

@gregorbg gregorbg force-pushed the feature/gcloud branch 2 times, most recently from 8dd1a0b to 3d858cb Compare November 4, 2019 21:52
Copy link
Contributor

@jfly jfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, will the WCA version of TNoodle include dependencies for Google App Engine? If so, I'm not wild about that.

My preference would be for us to focus on splitting TNoodle into smaller projects/repos, and this could be an example of something built using libtnoodle, but would not be part of the jar file that we give delegates for generating scrambles.

@gregorbg
Copy link
Member Author

gregorbg commented Nov 14, 2019

Accidentally bloating up the release JAR with Google libraries is an interesting thought. I will contemplate some more on that issue.

WST: Please do not merge until I find a solution. If I should withdraw the PR at all, just leave a comment ;)

@gregorbg
Copy link
Member Author

@jfly I figured out a solution that I'd like your opinion on: Instead of managing everything through webscrambles, I have introduced a second subproject called cloudscrambles that manages the Google SDKs on top of webscrambles.

When building the JAR for Delegates, we run ProGuard over webscrambles, so the Google libraries are not included. cloudscrambles extends that basic module, and adds the necessary infrastructure for cloud deployments on top (in a second, independent subproject).

Different file access variants are managed through the interface org/worldcubeassociation/tnoodle/server/util/ServerEnvironmentConfig.kt. This is required as a constructor parameter of TNoodleBaseServer now, so that essentially whenever you want to spin up a TNoodle server you have to pass TNoodle an implementation of that interface so the server knows how to read/write files for example.

@gregorbg
Copy link
Member Author

gregorbg commented Dec 8, 2019

Kindly ping @jfly, I'd like to get this thing merged before the end of the year :)

I have split the subprojects in such a way that the Google AppEngine dependencies will not be included in the distributable JAR for Delegates.

@gregorbg
Copy link
Member Author

Merging due to lack of additional feedback. We need this restructure for clean integration of tnoodle-lib.

@gregorbg gregorbg merged commit 9724b3f into thewca:master Dec 19, 2019
@gregorbg gregorbg deleted the feature/gcloud branch December 19, 2019 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants