-
Notifications
You must be signed in to change notification settings - Fork 41
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
Zeitgeist Client Update Automation #944
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samuelarogbonlo !
Impressed by ChatGPTs response:
The most important mistake to fix would likely be the lack of error handling and validation. This script does not check for errors that might occur during the download or execution of the software, which can make it difficult to troubleshoot issues if they arise. Additionally, it does not validate if the variable RELEASE_VERSION is set or not, which can cause issues if not set. This can result in the script trying to download the wrong version of the software or trying to download a version that does not exist.
Another important mistake would be the lack of compatibility and security checks. The script does not check if the new version of Zeitgeist software is compatible with the current system, or if the new version of the software is signed and verified or not. This could potentially lead to issues if the software is not compatible or if the new version is not verified and could be a security risk.
Lastly, the script does not check if the new version of Zeitgeist software is already installed or not, and does not check if the new version of Zeitgeist software is tested before applying the update. This could lead to unnecessary updates and could cause issues if the new version is not fully tested.
gather_facts: no | ||
become: true | ||
environment: | ||
RELEASE_VERSION: "{{ lookup('env', 'RELEASE_VERSION') }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we set RELEASE_VERSION
? In the environment variables? What happens, if it is not set? Can we print the RELEASE_VERSION in the Github Actions Debug Console?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RELEASE_VERSION
is automatically set by the Github client-auto-update.yml
workflow as an environment variable. So when the playbook is ran in, it looks for environment variable already set by the Github workflow. I may have to include some logic so the workflow can run if RELEASE_VERSION
is not specified, just to be on the safer side.
Codecov Report
@@ Coverage Diff @@
## main #944 +/- ##
==========================================
- Coverage 95.67% 94.69% -0.99%
==========================================
Files 90 92 +2
Lines 18779 19267 +488
==========================================
+ Hits 17967 18245 +278
- Misses 812 1022 +210
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main needs to be merged into this branch.
How can we test this before merging? Maybe by adding manual dispatch and executing it.
- name: Create Backup from Previous Zeitgeist Client | ||
no_log: true | ||
shell: | | ||
cd /services/zeitgeist/bin | ||
PREV_VERSION=$(./zeitgeist --version | grep -Eo '([0-9]{1,}\.)+[0-9]{1,}' | tr -d '.') | ||
mv zeitgeist zeitgeist_$PREV_VERSION.bak | ||
when: not mnt.stat.exists and mnt.stat.isdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to remove old backups here to avoid bloating.
shell: | | ||
cd /mnt/*/services/zeitgeist/bin | ||
PREV_VERSION=$(./zeitgeist --version | grep -Eo '([0-9]{1,}\.)+[0-9]{1,}' | tr -d '.') | ||
mv zeitgeist zeitgeist_$PREV_VERSION.bak | ||
when: mnt.stat.exists and mnt.stat.isdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to remove old backups here to avoid bloating.
- name: Download Zeitgeist Client to Mount Dir | ||
no_log: true | ||
shell: | | ||
cd /mnt/*/services/zeitgeist/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works as long as there are not two folder trees of the following form:
/mnt/<folder1>/services
/mnt/<folder2>/services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for now there's no more than one sub-directory in the /mnt/ directory. These sub-directories contain the parachain and relay-chain data mounted in volumes for each zeitgeist node.
if [[ -v RELEASE_VERSION ]]; then | ||
wget -O zeitgeist https://github.com/zeitgeistpm/zeitgeist/releases/download/$RELEASE_VERSION/zeitgeist_parachain | ||
else | ||
wget -O zeitgeist https://github.com/zeitgeistpm/zeitgeist/releases/download/v0.3.6/zeitgeist_parachain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v0.3.6
is bugged.
wget -O zeitgeist https://github.com/zeitgeistpm/zeitgeist/releases/download/v0.3.6/zeitgeist_parachain | |
wget -O zeitgeist https://github.com/zeitgeistpm/zeitgeist/releases/download/v0.3.4/zeitgeist_parachain |
Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: Harald Heckmann <[email protected]>
This pull request is now in conflicts. Could you fix it @samuelarogbonlo? 🙏 |
Blocked: Waiting for secrets to be added to GH |
fix: Set playbook name correctly (#944)
This should resolve (#924).
This PR contains the automation script to auto-update the zeitgeist clients on the self-hosted servers and OnFinality. @sea212 Can you possibly take a look at this whenever you can? Thanks.