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

added script to create new users, and import projects as template #2335

Merged
merged 2 commits into from
May 18, 2021

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented May 17, 2021

What do these changes do?

  • added a scipt to add new users
  • added a script to import/rename/publish as template an exported project

Example:

# this will create 20 users
for i in {01..20}; do ./create_user.py ENDPOINT puppeteer_$i@itis.testing PASSWORD; done
# this will import the project, and publish it as a template project shared with group with gid 2 and name it accordingly
./import_projects_as_template.py http://127.0.0.1:9081 iamauser@osparc.io PASSWORD /my/file/path/50b7\#SHA256=2538b018162c842fd1c67096a88ba2cb19366b39b8b93ec19a7afafeca7a7fdc.osparc --project-name "some funky name" --share-with-gid 2

Related issue/s

How to test

Checklist

@sanderegg sanderegg added the t:maintenance Some planned maintenance work label May 17, 2021
@sanderegg sanderegg added this to the Chinchilla milestone May 17, 2021
@sanderegg sanderegg self-assigned this May 17, 2021
@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #2335 (cf01ef1) into master (a14455b) will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2335     +/-   ##
========================================
- Coverage    71.8%   71.7%   -0.1%     
========================================
  Files         506     506             
  Lines       19925   19925             
  Branches     1949    1949             
========================================
- Hits        14315   14302     -13     
- Misses       5137    5146      +9     
- Partials      473     477      +4     
Flag Coverage Δ
integrationtests 61.9% <ø> (-0.1%) ⬇️
unittests 67.1% <ø> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...webserver/computation_comp_tasks_listening_task.py 84.0% <0.0%> (-6.0%) ⬇️
...ce_webserver/resource_manager/garbage_collector.py 74.8% <0.0%> (-2.8%) ⬇️
...erver/src/simcore_service_webserver/director_v2.py 78.0% <0.0%> (-0.8%) ⬇️

@sanderegg sanderegg requested a review from KZzizzle May 17, 2021 20:25
from pathlib import Path
from typing import Optional

import typer
Copy link
Contributor

Choose a reason for hiding this comment

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

this one is nice 👍

@sanderegg sanderegg changed the title added script to create new users added script to create new users, and import projects as template May 18, 2021

def main(
endpoint: str,
username: str,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if typer would validate and convert parameters if they are annotatedendpoint: URL, username: EmailStr, password:SecretStr. Otherwise, one could use the pydantic validator ?

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 tried.. and you get an error a la "this is not yet supported"

@sanderegg sanderegg merged commit d9beaae into ITISFoundation:master May 18, 2021
@sanderegg sanderegg deleted the add_useful_scripts branch May 18, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants