peachcloud / peach-config-rust

Rust crate which provides a CLI tool for installing and updating PeachCloud.
1 stars 1 forks source link

Almost at v1 #1

Open mhfowler opened 3 years ago

mhfowler commented 3 years ago

I think this repo is almost at parity with the original peach-config in python now.

By making a cmd utility, it ended up being quite similar to python, and I was able to do a lot of regex find and replace while I was re-writing which made it much quicker, plus of course still some tinkering needed and doing things differently in the two languages.

As there were command line arguments that effect the control flow, it ended up making more sense to me to just re-write entirely in rust like this, as opposed to invoking "bash scripts" from rust (because then I would have also needed to pass CLI arguments to the bash scripts, and additionally parse the CLI args in bash as well as rust). I think I like how it looks in rust anyway, and I like that it will be very extensible in the future, and has uniformity with the rest of the codebase. For instance, we could even decide to refactor something and move it out of peach-config and into peach-lib or a different microservice etc. and because its all rust, it wouldn't be that much of a hassle, which I think is a good thing for the future.

I was hoping to have it all wrapped up with perfect parity by the end of this week (arbitrary deadline I made for myself), but there are still a couple outstanding issues:

  1. I commented out the line about kernel.printk as it was throwing an error. I'm not sure the source of this error or how to fix it but thought maybe you would have some ideas? Something to note is there was also a kernel update since the last time I built the image, to vmlinuz-4.19.0-17-arm64. [2021-07-24T02:11:46Z ERROR peach_config] peach-config encounter an error: "["sysctl", "-w", "kernel.printk=4 4 1 7"]" returned an error. sysctl: cannot stat /proc/sys/kernel/printk: No such file or directory
  2. with that line commented out, the setup script runs fully to completion as before. When I log into the pi, it connects to the internet like before, but it is not resolving DNS correctly. I am not sure what the issue is. Maybe something with /etc/resolv.conf ? Thought you might have some ideas on this one too, or we could debug together.
  3. need to finish add CLI args for the peach-config update command
  4. need to add some more comments and documentation

cc @mycognosist

mhfowler commented 3 years ago

I was able to fix the resolved issue by adding this to /etc/systemd/resolved.conf

[Resolve]
DNS=8.8.8.8

note, that I don't think hardcoding google's DNS server is the solution that we want, but it is working for me for now

cc @mycognosist

mhfowler commented 3 years ago

@mycognosist I've finished updating the comments and documentation, and as well as the CLI args for the update command, so this is now at full parity with original peach-config, other than item 1, which I would like to debug with you together once you have more time.

I would vote to rename this repo to peach-config, and to rename the current peach-config to python-peach-config-archived or something like that.