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

Add a new ExecutionEnvironment model #7455

Conversation

jbradberry
Copy link
Member

@jbradberry jbradberry commented Jun 26, 2020

SUMMARY

Modeling and additions to the API for the new execution environments.

  • a new ExecutionEnvironment model
  • a new CredentialType
  • a mixin to include in executable models to point to an ExecutionEnvironment
  • a new configure-Tower-in-Tower setting to configure the global default EE
  • update Organization to have an optional default EE
  • update the Org serializer to show and set the default EE
  • update Project to have an optional default EE ????
  • update the Project serializer to show and set the default EE ????
  • update the serializers for other objects to include the EE and pull fields
  • an RBAC access class
  • add a new EE admin RBAC role ????
  • an EE serializer
  • an API list view, and expose in the /api/v2/ list
  • an API detail view
  • an API sublist view for Org <- EE relationships (not the Org -> "Default EE" relationship)
  • an API sublist view for EE <- Unified Job Templates
  • an API sublist view for EE <- Unified Jobs ????
  • add a Swagger topic
  • make sure that ActivityStream captures changes and associations
  • an API sublist view for EE <- ActivityStreams
  • add new Page types to awxkit
  • make EEs exportable and hook up anything else necessary to allow the other CLI commands to work
  • provide a way to create new EEs from scripts

related #7064

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • API
AWX VERSION
awx: 13.0.0

@jbradberry jbradberry self-assigned this Jun 26, 2020
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@AlanCoding
Copy link
Member

Could we get some writeup in docs/?

This doesn't actually run jobs in the execution environment right now? Does that depend on ansible/ansible-runner#470

I want to see what the contract is between the pieces of software. The best docs I've seen is this example:

https://github.com/jladdjr/ansible-runner/tree/04ea74015ece6bc08a6d734e9a4de6fe71c8eb06/test/integration/containerized/priv_data

---
idle_timeout: 60
job_timeout: 360
pexpect_timeout: 10
containerized: true
container_runtime: docker

Server code has a section for those settings in:

awx/awx/main/tasks.py

Lines 1421 to 1426 in 8ea31d8

'settings': {
'job_timeout': self.get_instance_timeout(self.instance),
'suppress_ansible_output': True,
**process_isolation_params,
**resource_profiling_params,
},

This remains very speculative, but I don't see why we can't add those settings there right now. We should also get the ability to run against ansible-runner branches. If we don't have that now, we should soon.

@jbradberry
Copy link
Member Author

@AlanCoding this is the very beginning of a draft. It's a bit early for review.

@jbradberry jbradberry force-pushed the execution-environments-model branch from d64ec51 to 476171a Compare June 30, 2020 15:30
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from 476171a to cac644f Compare June 30, 2020 19:03
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from cac644f to 6ef6f3f Compare July 1, 2020 14:50
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch 2 times, most recently from 733b1e3 to d6ab9fd Compare July 2, 2020 14:41
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from a02fb26 to 095a34f Compare July 6, 2020 15:01
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@jbradberry jbradberry force-pushed the execution-environments-model branch from 095a34f to b524a95 Compare July 6, 2020 16:34
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from b42ef83 to 4f6e98f Compare July 6, 2020 17:30
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

)
image = models.CharField(
max_length=1024,
verbose_name=_('image location'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest, "Image name, which may include registry and tag"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally the form field label gets set to this value, so do we really want to use something this verbose?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really like to see some content in the docs/ folder with the exact syntax that is expected to work.

Take https://quay.io/repository/ansible-tower/ansible-runner as an example, we're sandboxing with this in other places too. Would there be no credential with image of ansible-tower/ansible-runner? Even if that's the case, it's not as obvious as it might seem, and it would be good to have an example.

null=True,
default=None,
on_delete=models.SET_NULL,
)
Copy link
Member

@kdelee kdelee Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would awx log in w/ the credential and will ansible-runner always just assume we are already authenticated w/ the registry?

What type of registry credentials are we going to support?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I'm still pretty iffy on how this part will work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an idea of what credential type this will need, and can we enforce that in the serializer or clean methods?

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from e345ec1 to 0d09f59 Compare July 8, 2020 15:57
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from 0d09f59 to e50d52a Compare July 8, 2020 17:37
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from e50d52a to a443e42 Compare July 8, 2020 17:58
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry force-pushed the execution-environments-model branch from a443e42 to 8baaba3 Compare July 8, 2020 18:44
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@jbradberry jbradberry changed the base branch from devel to execution-environments July 20, 2020 14:37
@jbradberry jbradberry force-pushed the execution-environments-model branch from 8baaba3 to 3d26d27 Compare July 20, 2020 14:38
@jbradberry jbradberry changed the title [WIP] Add a new ExecutionEnvironment model Add a new ExecutionEnvironment model Jul 29, 2020
@jbradberry jbradberry marked this pull request as ready for review July 29, 2020 20:13
@jbradberry jbradberry force-pushed the execution-environments-model branch from 3d26d27 to 3c6c49a Compare July 30, 2020 14:35
@jbradberry jbradberry merged commit e50b25c into ansible:execution-environments Jul 30, 2020
@jbradberry
Copy link
Member Author

I'll capture the leftover bits (the ones we'll actually do, anyway) on another ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants