Skip to content
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

Research Red Hat Console Provisioning Service #167

Closed
TomasTomecek opened this issue Nov 15, 2022 · 3 comments · Fixed by #177
Closed

Research Red Hat Console Provisioning Service #167

TomasTomecek opened this issue Nov 15, 2022 · 3 comments · Fixed by #177
Assignees

Comments

@TomasTomecek
Copy link
Member

API: https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/RHEnVision/provisioning-backend/main/api/openapi.gen.json#operation/getReservationByID

Notes from our meeting with @ezr-ondrej today:

  • The provisioned machines need an account from which the costs are paid
    • Console uses a concept of Sources (check the API above)
  • We also need to figure out how people access the machines - SSH keys
    • An idea was to use SSH keys that we all have on GitHub
  • One idea is to run an "internal" workflow in the beginning for folks who have access to console.redhat.com
@TomasTomecek
Copy link
Member Author

Doing a poor-man's research, here in a comment.

A simple reservation flow:

REQUEST
Packit → Provisioning API

{
"amount": 0,                    # we'd hardcode 1, we always want only a single VM in our PoC
"image_id": "string",           # using the one from image builder
"instance_type": "string",      # again, hardcode the smallest thing possible
"launch_template_id": "string", # (optional), we could create our own template in AWS
"name": "string",               # yes
"poweroff": true,               # false - should be live asap
"pubkey_id": 0,                 # we'd first create it, then use it
"region": "string",             # probably hardcode, would be configurable over time
"source_id": "string"           # hardcode
}

RESPONSE
Provisioning API → Packit

{
"amount": 0,
"aws_reservation_id": "string", # probably an ID in context of console.rh.c
"image_id": "string",
"instance_type": "string",
"instances":                    # we'd probably need to use AWS' API to get an IP address
"string"
],
"launch_template_id": "string",
"name": "string",
"poweroff": true,
"pubkey_id": 0,
"region": "string",
"reservation_id": 0,
"source_id": "string"
}

@ezr-ondrej
Copy link

Hi all and @TomasTomecek !

I believe it is possible to create source through API , I agree it's not very obvious and put the correct request together is non-trivial, here is what we've come up with to seed data through api in local develepement instance of sources: https://github.com/RHEnVision/provisioning-backend/blob/main/scripts/sources.seed.sh

Happy to help with getting the correct payload together with you for your needs ;)

Another good news (hopefully) is that we are currently working on a last step of the launch, that would wait for the instance to come up and fetch it's IP & FQDN, it's not perfect and if the instance does not come up within some time (currently we are thinking 6 secs) the IP wont be there, but still it might be usable in your usecase :)

@TomasTomecek
Copy link
Member Author

https://issues.redhat.com/browse/HMS-1133 card for the IPs and FQDN

@TomasTomecek TomasTomecek self-assigned this Apr 14, 2023
TomasTomecek added a commit to TomasTomecek/research that referenced this issue Apr 17, 2023
Fixes packit#167

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants