Comments (8)
I cannot speak for the author whether this is the correct way, seeing both libraries is under active development (especially this one), I'd expect a better installation process in the future.
What I did to get it working: (should not be a reliable way)
start a new virtual env,
pip install -U git+git://github.com/CermakM/argo-client-python.git
pip install -U git+git://github.com/CermakM/argo-python-dsl.git
from argo-python-dsl.
sorry guys to bombard you all with questions, I have one more question.
how can I specify which Service Account to use when I submit a workflow?
for eg with argo cli I can doargo submit --serviceaccount my-serviceaccount --watch https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml
how can I specify service account? either in
dsl
orcreate_namespaced_workflow
?
if anyone else is wondering about this one. I got it to work using @CermakM 's help.
here's how you can do that, specify service_account_name
in Workflow class.
class HelloWorld(Workflow):
entrypoint = "whalesay"
service_account_name = "argo-workflow"
@template
def whalesay(self):
container = V1Container(
image="docker/whalesay:latest",
name="whalesay",
command=["cowsay"],
args=["hello world"]
)
return container
from argo-python-dsl.
again thanks a lot @CermakM for great work. :-)
from argo-python-dsl.
Hi, can you uninstall argo-models
and install argo-client-python ?
pip install -U git+git://github.com/CermakM/argo-client-python.git
What I have is different than yours:
argo-workflows 3.0.0rc0
argo-workflows-dsl 0.1.0.dev0
I am not sure what is argo-models
project though.
here is the code successfully submit the hello-world example for me.
from argo.workflows.client import V1alpha1Api
from argo.workflows.config import load_kube_config
from argo.workflows.dsl import Workflow
from argo.workflows.dsl import template
from argo.workflows.dsl.templates import V1Container
from argo.workflows.config import load_kube_config
load_kube_config()
api = V1alpha1Api()
class HelloWorld(Workflow):
entrypoint = "whalesay"
@template
def whalesay(self) -> V1Container:
container = V1Container(
image="docker/whalesay:latest",
name="whalesay",
command=["cowsay"],
args=["hello world"]
)
return container
wf = HelloWorld()
print(wf)
result = api.create_namespaced_workflow('argo', wf)
print(result.metadata.name)
from argo-python-dsl.
how did you install argo-workflows-dsl
though? I cloned master
branch and did python setup.py install
is that the correct way to install?
from argo-python-dsl.
@yxue-kabam That is exactly right and thanks for the active participation.
The client library has already been released to PyPI: https://pypi.org/project/argo-workflows/,
so it can be installed directly as pip install -U argo-workflows
.
The DSL, however, is indeed under active development and it is currently 'safer' to install it from github directly.
@brtasavpatel does the problem with the import persist? As far as the other issue is concerned, I commented right there :)
PS: argo-models
are not my doing and are not related to this library
from argo-python-dsl.
thanks @yxue-kabam and @CermakM for the replies, I think because of that argo-models
package I had some module name conflicts that's why it wasn't working,
code snippet above works, though there's one issue with that (I don't know if it's intentional)
when I try to submit same workflow twice I get
ApiException: (500)
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Wed, 26 Feb 2020 22:32:48 GMT', 'Content-Length': '286'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"The POST operation against Workflow.argoproj.io could not be completed at this time, please try again.","reason":"ServerTimeout","details":{"name":"POST","group":"argoproj.io","kind":"Workflow"},"code":500}
Here this exception is totally misleading. I have investigated and found out that it's failing because argo doesn't allow same names for the workflows. if I set workflow name to empty string like this : wf.name = ''
I can submit the workflow multiple times.
I wanted to know Is this an intended behavior?
from argo-python-dsl.
sorry guys to bombard you all with questions, I have one more question.
how can I specify which Service Account to use when I submit a workflow?
for eg with argo cli I can do
argo submit --serviceaccount my-serviceaccount --watch https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml
how can I specify service account? either in dsl
or create_namespaced_workflow
?
from argo-python-dsl.
Related Issues (20)
- Host as part of Argo Labs HOT 10
- Development plan and contribution HOT 3
- Dynamic Template & Task generation
- how to use V1Volume, V1Toleration etc? HOT 3
- workflow.from_url is not taking `url` HOT 1
- Missing kind and other metadata HOT 3
- [Discussion] Dynamic task generation HOT 2
- AttributeError: 'dependencies' object has no attribute 'model' HOT 4
- new install from master - as require the full body posted on submit HOT 6
- Would you consider integration with the component format of Kubeflow Pipelines?
- how to set pod-metadata HOT 2
- how to use with_param decorator HOT 2
- submit failed, prompt "argo.workflows.client.rest.ApiException: (400)" HOT 6
- Nested DAGs HOT 1
- Functional API? HOT 3
- Argo Python SDK -> to Argo Python DSL
- Documentation comparing to Kubeflow Pipelines Python SDK
- Workflow metadata name parsed from class name prevents generated name from working HOT 2
- AttributeError: 'NoneType' object has no attribute 'parameters' from Workflow.submit() HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argo-python-dsl.