Merge `agents` and `frontends` into one `pods`
Intro
The scope of this issue, is to merge agents
and frontends
into pods
, which can be used for multiple things, not just challenges and frontends for the users, but also pr. event instances or scoreboards!
Whatevery you want pretty much.
Merging
The way they will be is with a basic table which vaguely describes a pod
, and then a tags
and attributes
table.
These tables should be enough to get all the functionality we need!
It should also be noted, that the use of creating a public/private
key pair is no longer needed, as it should use the one at DO specified.
pods
- id (string)
- claim (string) (? - up for discussion)
- image (string) - image used for creation
- ip (string)
Which will be aided by two tables pods_tags
, pods_attributes
.
pods_tags
- id (int)
- pod_id (int)
- tag (string)
pods_attributes
- id (int)
- pod_id (int)
- key (string)
- value (string - converted on the backend)
- type (string - (string|int|bool))
Examples
These will quickly describe how the current structure will be in the new structure.
Agent
It should create a pod with the tag agent
and the attributes:
- lastbeat (int64)
- claim (if not in the `pods`)
This would be enough for it to function properly
Frontend
Create a pod with the tag frontend
, and attribute claim
if not in pod.
If it want to allow users to login (which it should, considering it is a frontend), it can either have a new field in attributes called password
or something like that, e.g.
ssh_username root
ssh_password jflkdsjflkjs
vnc_username user
vnc_password pass
Client - cmd
Should have a pod
and pods
menu, where pods
can easily be filtered by the keyword coming after it
Templates
We should make a scripts
repository which holds methods of generating the images used, e.g. agent image, frontend
debian, etc.
Plan of action
-
Remove everything regarding agent/frontends and replace with pods -
Remove frontend stuff -
Renamed agents to pods -
Update store to use pods -
Remove container related stuff (should not be on the pods unless in attributes) -
Add pods menu to cmd -
Update agent to support pods
-
-
Make a challenges struct some place -
Make a agent
template -
Make a frontend
template -
?? More
Notes
Tags
Tags agent
and frontend
will be reserved in that way, the agents
will be used for challenges.
Templates
Templates should all support cloudinit and they will get a server_ip
and a api_key
to talk with the backend for whatever they might need (if the template supports this).