-
Notifications
You must be signed in to change notification settings - Fork 2
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
BUG - Can't submit Argo Workflow via Hera on Nebari 2023.7.1 #19
Comments
The error indicates that the user wasn't found, which is expected, but NWC assumes that the "workflows.argoproj.io/creator-preferred-username" is set on the workflow which it seems is not the case. At a minimum, we should check if that label is there and return a better error message if not. However, NWC should support workflows being submitted via Hera so that needs to be corrected. I can't access the NWC logs to see what NWC is getting passed as an input however (Argo Workflows adds some labels so I want to see the workflow after that happens before I can debug). |
Workaround for the time being is to disable Nebari Workflow Controller in the nebari config yaml.
|
I've confirmed that the error goes away and hera/argo is functional after disabling NWC |
As I see it, there are at least three ways ways of submitting Argo-Workflows now:
Submitting workflows via Hera-Workflows has always required the user to copy and paste their import os
from urllib.parse import urljoin
from hera.workflows import Workflow, script
from hera.shared import global_config
def authenticate():
namespace = os.environ["ARGO_NAMESPACE"]
if not namespace:
namespace = "dev"
token = "Bearer v2:ey....." # <-- copied from Argo UI
if token.startswith("Bearer"):
token = token.split(" ")[-1]
base_href = os.environ["ARGO_BASE_HREF"]
if not base_href.endswith("/"):
base_href += "/"
server = f"https://{os.environ['ARGO_SERVER']}"
host = urljoin(server, base_href)
global_config.host = host
global_config.token = token
global_config.namespace = namespace
return global_config
authenticate()
with Workflow(
generate_name="hello-world-",
entrypoint="hello",
arguments={"s": "world"},
) as w:
hello()
w.create() One workaround that doesn't require you to copy over your import os
from urllib.parse import urljoin
from hera.workflows import Workflow, script
from hera.shared import global_config
def sanitize_label(s: str) -> str:
s = s.lower()
pattern = r"[^A-Za-z0-9]"
return re.sub(pattern, lambda x: "-" + hex(ord(x.group()))[2:], s)
def authenticate():
namespace = os.environ["ARGO_NAMESPACE"]
if not namespace:
namespace = "dev"
token = os.environ["ARGO_TOKEN"]
if token.startswith("Bearer"):
token = token.split(" ")[-1]
base_href = os.environ["ARGO_BASE_HREF"]
if not base_href.endswith("/"):
base_href += "/"
server = f"https://{os.environ['ARGO_SERVER']}"
host = urljoin(server, base_href)
global_config.host = host
global_config.token = token
global_config.namespace = namespace
return global_config
authenticate()
labels = {
"workflows.argoproj.io/creator-preferred-username": sanitize_label("eeriksen@quansight.com")
}
with Workflow(
generate_name="hello-world-",
entrypoint="hello",
arguments={"s": "world"},
labels=labels,
) as w:
hello()
w.create() The long-term solution is to generate personalized Argo tokens for each user and add them to as env vars on the user's JupyterLab pod. This has been captured in this issue. |
Allowing users to set their own creator-preferred-username is a vulnerability since now users can claim to be any user they want and have those files mounted. I'll open an issue to correct that. |
The following script throws an error.
The error thrown is
Unwrangling hera a bit via
shows me that what is submitted is
The text was updated successfully, but these errors were encountered: