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

rewrite static website using jekyll #634

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open

Conversation

maul-esel
Copy link
Contributor

@maul-esel maul-esel commented Jun 3, 2023

As discussed, this PR rewrites the static website.

  • Instead of dynamically loading static content via javascript, the website now uses a static site generator (jekyll) to generate static HTML at build time.
  • For the webinterface, javascript is (of course) still used to query the backend API and to dynamically render the returned results. This part is largely unchanged.
  • The URLs of the new site look prettier 😉 -- e.g. tools/automizer instead of ?ui=tool&tool=automizer . Old URLs are redirected (using javascript) to the new URLs for backward compatibility with existing links.
  • This PR does not attempt to change the look or content of the site. Any such changes should be handled in a separate PR once this is merged.

Of course there is always more to improve, but I would consider the rewrite to be pretty much complete. Please point out any mistakes and bugs if present.

TODO

  • Rewrite to jekyll
  • Before this is merged, I plan to update and extend the site documentation, to make future maintenance easier. Feel free to let me know if there are any particularly important aspects to be documented.
  • Set up automated deployment -- via jenkins, or via github Actions?

@danieldietsch
Copy link
Member

Before we can merge this we need a proof-of-concept deployment. At the very least we need the following.

  • Instructions on how to generate a new site for Windows and Linux, including all necessary dependencies
  • An integration into Maven (best) or into a separate website deployment script that builds back and frontend (not so nice, because we would need Maven anyways to build the backend).

Regarding the deployment TODO: we should not use Github actions, because we do not want to concern us with Github's billing policies. We should use our Jenkins.

@danieldietsch
Copy link
Member

@maul-esel Also, the tool pages do not work, and it looks like the web interface does not work as well. At least when I use Jekyll locally.
image
image

@danieldietsch
Copy link
Member

When using jekyll serve I get various ...site.webmanifest not found errors. Should I be concerned?

@maul-esel
Copy link
Contributor Author

maul-esel commented Jun 4, 2023

This restores the behaviour of the webinterface before the rewrite.
Also, simplify the related code: The 'ui' query param is no longer
used, and helpers.js is only used for the webinterface.
@maul-esel
Copy link
Contributor Author

it looks like the web interface does not work as well

From the screenshot, it looks like the problem may be that no tool is selected -- the URL should have a parameter like ?tool=automizer or similar.

  • How did you get there? Is there a broken link somewhere?
  • I've restored the previous behaviour in such cases: redirect to the home page.

@bahnwaerter
Copy link
Member

@bahnwaerter had some ideas on how to integrate the build in maven. Maybe we can discuss them next week? [...]

A very simple integration would be possible with the maven-exec-plugin. This plugin can execute programs like jekyll as if you would use a command line. We could use that in an extra Maven profile for generating the static website artifacts in the Maven lifecycle. However, an automatic deployment afterwards will be a bit more difficult. But we can talk about that next week.

@danieldietsch
Copy link
Member

danieldietsch commented Jun 4, 2023

@maul-esel @bahnwaerter

  1. now the links and the webinterface works. For the latter, the issue was that I did not do cp js/webinterface/config.dist.js js/webinterface/config.js, so its probably expected ;)
  2. I again needed to do bundle update to get 4f0fe87 -- is there a way one can do that directly for multiple platforms?
  3. Jenkins vs Github: no worries, I am happy to talk about how Jenkins works. Wrt. GH actions: ok, it looks free for now, but I still don't like it. For example, I just spent some time trying to find out what standard runners are and if there are non-standard runners. So far, I did not succeed. I also don't like the idea of supporting both, Jenkins and Github actions. And the default runners (https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) look like they might be too weak to run an Ultimate nightly.
  4. Maven integration with maven-exec-plugin: Yes, this would be possible, but we would gain nothing compared to just using a bash script. Perhaps we should go along the lines of https://sketchingdev.co.uk/blog/continuous-deployment-of-jekyll-website-with-jenkins.html and add a docker runner while we are at it. A second WebBackend only job could be started so that we can combine the deployment of website and backend in one pipeline.

# Conflicts:
#	trunk/source/WebsiteStatic/js/webinterface/tool_interface.js
@maul-esel
Copy link
Contributor Author

maul-esel commented Jun 15, 2023

@bahnwaerter and I looked into the automatic build:

  • We got maven to build the site using the maven-exec-plugin. @bahnwaerter still wants to make some changes (e.g. make it possible to build only the website, rather than all plugins) and then commit the changes here.
  • We should add a possibility to distinguish between development and production builds (to maven).
  • For production builds / during deployment, we should also copy the correct config.js.
  • We still have the problem that different platforms lead to different Gemfile.lock files -- @danieldietsch, @bahnwaerter and I each get different results. I'll try to find some time to look into that.
  • We need a jenkins job to deploy the site.
    • Do we want to use the docker plugin for jenkins, and run the frontend build in a container?
  • We want to convert .epf to .json for the settings files, as part of the build / deployment.
    • While we're at it, we might also separate the tool settings from other settings in config.js.

# Conflicts:
#	trunk/source/WebsiteStatic/config/config.dist.js
#	trunk/source/WebsiteStatic/webinterface/convert_settings.py
#	trunk/source/WebsiteStatic/webinterface/overriden_settings.json
@bahnwaerter
Copy link
Member

@maul-esel can you undo your merge of the dev branch into this branch and do a rebase instead? Otherwise, I'm not able to review the code changes of this pull request.

# Conflicts:
#	releaseScripts/website-config/frontend/config.js
#	trunk/source/WebsiteStatic/config/config.dist.js
#	trunk/source/WebsiteStatic/webinterface/code_examples/boogieReferee/McCarthy91-withSpecification.bpl
#	trunk/source/WebsiteStatic/webinterface/code_examples/cReferee/GoannaDoubleFreeInt.c
#	trunk/source/WebsiteStatic/webinterface/code_examples/cReferee/IncrementGlobal.c
#	trunk/source/WebsiteStatic/webinterface/code_examples/cReferee/linear-inequality-inv-a.c
#	trunk/source/WebsiteStatic/webinterface/code_examples/cReferee/mc91.c
@schuessf
Copy link
Contributor

What exactly is needed here until we can merge it? There is now a python script that can convert settings (from epf to json). If I understand it correctly to build the website, you can just run this script and jekyll serve or am I missing something?

@danieldietsch
Copy link
Member

@schuessf did you try that? How do we deploy it?

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.

None yet

4 participants