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

Enable Sample Gallery operations #77

Open
AlbertDeFusco opened this issue Nov 7, 2019 · 1 comment
Open

Enable Sample Gallery operations #77

AlbertDeFusco opened this issue Nov 7, 2019 · 1 comment

Comments

@AlbertDeFusco
Copy link
Collaborator

Here's the current known procedure to promote a project to the sample gallery.

  1. Create the desired project
  2. Share the project with all (or desired users)
  3. Use ae5-tools to promote to the sample gallery.
from ae5_tools.api import AEUserSession
import json

ae5 = AEUserSession('ae540-40.training.anaconda.com', 'anaconda-enterprise', 'anaconda-enterprise')

download_url = ae5.revision_info('user01/Untitled Project')['url']

new_sample_project = {}
new_sample_project['id'] = 'new-project'
new_sample_project['name'] = 'New Sample Project'
new_sample_project['description'] = 'My sample project'
new_sample_project['owner'] = 'anaconda-enterprise'
new_sample_project['download_url'] = download_url

ae5._post('sample_projects', data=json.dumps(new_sample_project))
@AlbertDeFusco
Copy link
Collaborator Author

Updated

  1. as root create the following directory on AE Master /opt/anaconda/storage/object/anaconda-objects/global
  2. as root copy project archive to the AE Master node in the /opt/anaconda/storage/object/anaconda-objects/global directory
  3. The URL for the archives placed in this directory is https://<domain>/platform/storage/api/v1/global/objects/<filename>

With ae5-tools you will need to login as an ae-admin user.

from ae5_tools.api import AEUserSession
import json

DOMAIN = '<your ae5 hostname>'
FILENAME = '<file name of project uploaded to master node>'

ae5 = AEUserSession(DOMAIN, 'anaconda-enterprise', 'anaconda-enterprise')

download_url = f'https://{DOMAIN}/platform/storage/api/v1/global/objects/{FILENAME}'

new_sample_project = {}
new_sample_project['id'] = '<short-name-for-project>'
new_sample_project['name'] = '<full-name-for-project>'
new_sample_project['description'] = '<project-description>'
new_sample_project['owner'] = 'anaconda-enterprise'
new_sample_project['download_url'] = download_url
new_sample_project['is_template'] = False  # set to True to add to Create Project list

ae5._post('sample_projects', data=json.dumps(new_sample_project))

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

No branches or pull requests

1 participant