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

Upgrade to Payara 6 & Allow Installations of Snapshot Versions #84

Merged
merged 31 commits into from
Sep 8, 2023

Conversation

MRichards99
Copy link
Contributor

This PR makes three main changes:

  • ICAT Ansible now uses Payara 6 Alpha, instead of Payara 5
  • Snapshot releases can now be installed when a URL is specified
  • Components are now installed when the version currently installed doesn't match that of the local Ansible variable

Changing to Payara 6 only involved changing the version number and editing the Java dependencies to Java 11. I have tested the RedHat changes works on my Centos 7 VM, and GitHub Actions takes care of the Ubuntu testing.

Snapshot releases can be installed by specifying a URL in group_vars/all/vars.yml in the format of COMPONENT_NAME_snapshot_url. These variables only work with snapshot releases, not full release URLs. We still have the COMPONENT_NAME_version to use for full releases so I'm hoping this isn't a problem. I've left examples commented out to show how it can be used (these are the current snapshot releases for the move to Payara 6). I've made changes in each of the role's main task file to extract the version number and filename from the URL. I've changed the regex to find war files as this wasn't behaving correctly with snapshot releases. These changes have been replicated in all the roles where the software is fetched from repo.icatproject.org and I've tested the changes on a run through of hosts_all.yml.

I've also made a change to when components are installed (see the when clauses at the bottom of the main.yml files I've changed). A component is now installed when the currently installed version doesn't match the version stored in COMPONENT_NAME_version. This means that if you have a component currently installed and you want to install the new snapshot (for example), you can now do that. Before this change, the installation steps would be skipped over if you had it installed (no version checks were done). We didn't discuss this so you might not find this change desirable, but I think it makes the playbook more logical to use for a human because you don't have to uninstall old components before upgrading their versions. I made an identical change with Payara too.

I also fixed ids_storage_file where it looks for war files that don't match the current version. This component seems to use jar files instead, so I've swapped the w's for j's.

GitHub Actions fails when installing ICAT Server. This is because it's trying to install 4.11.1 (made for Java 8) on Payara 6 Alpha. As stated above, I did a full run through of hosts-all.yml on my VM and it ran successfully. I did have to comment out the ids_server role because there is no snapshot release for that yet. Interestingly, ids_storage_file worked despite using the version from 2021 - I guess changes might not be needed for that component?

@MRichards99
Copy link
Contributor Author

I've made a couple of further changes.

I've uncommented the snapshot URLs so I can point the ICAT components with GitHub Actions to this branch and we can effectively run the tests for the components via GitHub Actions. @ajkyffin I've done this on icat.server, authn.anon and authn.db. The others either don't have GitHub Actions on them or don't use ICAT Ansible in their Actions workflow (because the tests don't rely on other ICAT components).

I've also made the Java version configurable, between 8 and 11. Can't remember if we discussed this in the meeting last week but I noticed this on the project board. I've set it to 11 by default for now.

The GitHub Actions on this branch now fails when installing the IDS because there's no snapshot for this yet.

line: 'AS_JAVA="/usr/lib/jvm/java-1.8.0-openjdk-amd64"'
regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.8\.0-openjdk-amd64"$'
line: 'AS_JAVA="/usr/lib/jvm/java-1.11.0-openjdk-amd64"'
regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.11\.0-openjdk-amd64"$'
Copy link
Collaborator

Choose a reason for hiding this comment

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

The regex should just be ^AS_JAVA=. It should match the line you want to replace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should pick up both Java 8/11, I missed that in this file. I'll make the change and test

@MRichards99
Copy link
Contributor Author

1bc9a77 fixes an issue where GitHub Actions was failing because lxml wasn't installed. This branch is now back at the state where the IDS fails to install due to a lack of a snapshot version.

@louise-davies
Copy link
Collaborator

Is this able to setup the database triggers added in ICAT 5 for the fileSize/fileCount fields? As we'll be using these in DG and so will need them in our e2e tests

@ajkyffin
Copy link
Collaborator

Is this able to setup the database triggers added in ICAT 5 for the fileSize/fileCount fields? As we'll be using these in DG and so will need them in our e2e tests

@louise-davies No, and it's out of the scope of this PR. That should probably be done in the icat.server setup script.

@ajkyffin ajkyffin force-pushed the payara6 branch 2 times, most recently from 71cc6ea to 8cdd5e5 Compare August 7, 2023 14:46
@ajkyffin ajkyffin self-requested a review September 7, 2023 14:59
Copy link
Collaborator

@ajkyffin ajkyffin left a comment

Choose a reason for hiding this comment

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

I think we should get this merged now even though it installs a snapshot version of ids.server.

@ajkyffin ajkyffin merged commit aeea97b into master Sep 8, 2023
2 checks passed
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.

3 participants