Skip to content

Commit

Permalink
client+ / prevent project create on operator
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmonteiro committed Jun 18, 2024
1 parent 2ab1781 commit d71a770
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git+https://github.com/tercen/tercen_python_client@0.10.7
git+https://github.com/tercen/tercen_python_client@0.11.1


16 changes: 10 additions & 6 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ def run_with_params(params, mode="cli"):
client = params["client"] # Running as operator

# Create temp project on which to run tests
project = Project()
project.name = 'template_test_' + ''.join(random.choices(string.ascii_uppercase + string.digits, k=12))
project.acl.owner = params['user']
project = client.projectService.create(project)
params["projectId"] = project.id
if mode == "cli":
project = Project()
project.name = 'template_test_' + ''.join(random.choices(string.ascii_uppercase + string.digits, k=12))
project.acl.owner = params['user']
project = client.projectService.create(project)
params["projectId"] = project.id
else:
project = tercenCtx.client.projectService.get(params["projectId"])

# Clone the template project from git into the temp project
importTask = GitProjectTask()
Expand Down Expand Up @@ -297,7 +300,8 @@ def run(argv):
# stepId="1ba15e7c-6c3e-4521-81f2-d19fa58a57b9")
tercenCtx = ctx.TercenContext()
params["client"] = tercenCtx.context.client

wkf = tercenCtx.client.workflowService.get(tercenCtx.get_workflow_id())
params["projectId"] = wkf.projectId

opMem = tercenCtx.operator_property('Memory', typeFn=int, default=-1)
gitToken = tercenCtx.operator_property('Github Token', typeFn=str, default="")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
packages=["workflow_funcs", "workflow_runner"],
package_dir={'workflow_funcs': 'workflow_funcs', "workflow_runner":'.' },
install_requires=[
'tercen_python_client @ git+https://github.com/tercen/tercen_python_client@0.10.7'
'tercen_python_client @ git+https://github.com/tercen/tercen_python_client@0.11.1'
],
entry_points={
"console_scripts": [
Expand Down

0 comments on commit d71a770

Please sign in to comment.