-
Notifications
You must be signed in to change notification settings - Fork 5
Auto configure persistent Tenks networking #26
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
base: smslab/2024.1
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @MaxBed4d, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the deployment process by updating the Kayobe repository reference and implementing a mechanism for persistent Tenks networking. The changes ensure that network configurations for Tenks deployments are automatically applied and maintained even after system reboots, improving the stability and reliability of the deployed environment. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the a-seed-from-nothing.sh
script to automatically configure persistent networking for Tenks. The changes involve pointing to a specific fork and branch of Kayobe and adding logic to install and enable a systemd service for network persistence. My review focuses on improving the script's robustness and adherence to best practices for file installation on a Linux system. I've suggested using install
instead of chmod
and mv
for better idempotency and correctness in setting file permissions, and recommended a more appropriate directory for the custom script.
# Make sure unit service and script are executable | ||
chmod +x ~/deployment/src/kayobe-config/tenks-network-on-boot.service | ||
chmod +x ~/deployment/src/kayobe-config/tenks-network-setup | ||
|
||
# Move Service and Script to correct directory | ||
sudo mv ~/deployment/src/kayobe-config/tenks-network-on-boot.service /etc/systemd/system/ | ||
sudo mv ~/deployment/src/kayobe-config/tenks-network-setup /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.
There are a few improvements that can be made to this block to align with best practices for shell scripting and system administration:
- Systemd unit files (
.service
) do not need to be executable. Standard permissions are644
. - Using the
install
command is preferable tochmod
followed bymv
. It can copy the file and set its permissions in a single, atomic operation. It also copies rather than moves, which can make the script more idempotent if it needs to be re-run. - For custom scripts,
/usr/local/bin
is a more appropriate directory than/bin
, which is typically reserved for essential system binaries. This follows the Filesystem Hierarchy Standard (FHS).
Here is a suggestion that incorporates these improvements:
# Make sure unit service and script are executable | |
chmod +x ~/deployment/src/kayobe-config/tenks-network-on-boot.service | |
chmod +x ~/deployment/src/kayobe-config/tenks-network-setup | |
# Move Service and Script to correct directory | |
sudo mv ~/deployment/src/kayobe-config/tenks-network-on-boot.service /etc/systemd/system/ | |
sudo mv ~/deployment/src/kayobe-config/tenks-network-setup /bin/ | |
# Copy Service and Script to correct directory and set permissions | |
sudo install -m 644 ~/deployment/src/kayobe-config/tenks-network-on-boot.service /etc/systemd/system/ | |
sudo install -m 755 ~/deployment/src/kayobe-config/tenks-network-setup /usr/local/bin/ |
This requires the merging of both PR#481 & PR#201