xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / scripts / worker.TODO (5d062eea9544a532df5073c4afae727082f9465c) (2,314B) (mode 100644) [raw]
[ ] Switch to pools of workers and dynamically attach disks.
<disk type="block" device="disk">
  <driver name="qemu" type="raw" cache="none" io="native" iothread="2"/>
  <source dev="/dev/xxx"/>
  <target dev="vdb" bus="virtio"/>
</disk>
# virsh attach-device vm1 dev1.xml

[ ] Refuse jobs if the number of cpus/mem/etc. is too big for all workers.
[ ] Clean images after build. Shred?
[ ] Add the templates to rocketgit git.
[ ] Add a secure channel for comunication between worker and server.
	Done. Use it. For example, to detect if the VM started.
	And, then, for streaming logs. Maybe for abrupt abort?
[ ] In case of errors, seems the error is not stored in Settings/Workers/List.
	Instead, it seems that everything was ok. :(
[ ] 'status' per cmd seems to not be set.
[ ] Log repo/branch/etc. which triggered the webhook.
[ ] We need to be able to restart/reload_the_conf at any time.
	Think about raising the number of machines in the pool.
	So we need to have the current tasks in a fs queue.
[ ] Activate SELinux with a custom profile.
[ ] Activate AppArmor with a custom profile.
[ ] About resources availability: who is able to set them?
	The web interface or the worker? I think the worker.
[ ] Add notification channels to be able to notify if the build was ok/bad.
	At least notify the project owner.
[ ] Take load in consideration?
[ ] Specify a pool size per 'env' section?
[ ] Specify a global max pool size?
[ ] When starting, load all $conf['state'] . '/job-*.ser' files and send a DON
	command to the server. Or maybe ask the server if needed?
[ ] Add a build_job_history table to store the tries to show them on the web?
[ ] If the user never confirmed the e-mail address, maybe we should not allow
	network access to the build jobs? Or, maybe, do not allow build jobs?
	Maybe do not allow to add hooks?
[ ] Build a load graph based on stats.
[ ] Allow admin, when adding a worker, to disable network access.
[ ] Should we validate we are talking with the correct server? I think yes.
	At least on tcp:// connections. Do we already do this?
[ ] Do we store somewhere how much time took to start the VM?
[ ] Upload some meta info about artifacts (branch, tag, start etc.).
[ ] Somehow, we need to inform the server the total size of the artifacts.
	This way we can have some progress bar.
[ ] 
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master