https://prefect.io logo
Docs
Join the conversationJoin Slack
Channels
announcements
ask-marvin
best-practices-coordination-plane
data-ecosystem
data-tricks-and-tips
events
find-a-prefect-job
geo-australia
geo-bay-area
geo-berlin
geo-boston
geo-chicago
geo-colorado
geo-dc
geo-israel
geo-japan
geo-london
geo-nyc
geo-seattle
geo-texas
gratitude
introductions
marvin-in-the-wild
prefect-ai
prefect-aws
prefect-azure
prefect-cloud
prefect-community
prefect-contributors
prefect-dbt
prefect-docker
prefect-gcp
prefect-getting-started
prefect-integrations
prefect-kubernetes
prefect-recipes
prefect-server
prefect-ui
random
show-us-what-you-got
Powered by Linen
prefect-server
  • j

    Joël Luijmes

    09/27/2021, 9:25 AM
    Hey, got a small PR to configure apollo body size. As I’m not sure if maintainers periodically check for open PRs, I thought I just mention it through slack 🙂 https://github.com/PrefectHQ/server/pull/296
    ✅ 1
    k
    • 2
    • 1
  • s

    Scarlett King

    09/27/2021, 3:34 PM
    Hi, I’m having my project structured as below: Project_name — flows / flow.py — tasks — task1.py — task2.py So flow.py import tasks from task1.py and task2,py like so
    from project_name.tasks import …
    I’m trying to deploy this by running
    prefect register
    —project project_name -m “project_name.flows” But I’m getting error No module named ‘project_name’. What is the best way to do this? I’m trying to deploy the flow on Azure store
    k
    m
    d
    • 4
    • 11
  • a

    Alexander van Eck

    09/27/2021, 5:14 PM
    Hello 👋 I’m trying to understand state_handlers in Task. When a Task is currently running and I cancel the flow are the state_handlers executed? I ask b/c I have a task which calls out to a remote resource and waits, then when the flow is cancelled that task should let the remote resource know we’re no longer waiting.
    def cancel(obj: Union[Task, Flow], _: State, new_state: State) -> State:
        if isinstance(new_state, (Cancelling, Cancelled)):
            obj.some_arg.cancel() # let them know we're no longer waiting
    
        return new_state
    
    
    class RemoteTask(Task):
        def __init__(self, *args: Any, **kwargs: Any) -> None:
            state_handlers = kwargs.pop('state_handlers', [])
            state_handlers.append(cancel)
            kwargs['state_handlers'] = state_handlers
            super().__init__(*args, **kwargs)
    k
    • 2
    • 14
  • a

    Aric Huang

    09/27/2021, 5:32 PM
    Hi, I am running Prefect Server+UI and was able to place it behind an nginx reverse proxy with basic auth. However I'm also trying to secure access using the CLI, and looking through the code it doesn't seem to support passing any kind of auth data when using the
    server
    backend. Are there any recommended ways of handling server auth through the CLI, and/or is there a possibility of adding some auth options (e.g. basic auth, bearer token) to the CLI when using
    server
    backend?
    k
    m
    +2
    • 5
    • 26
  • i

    Ismail Cenik

    09/27/2021, 9:32 PM
    Hello, I have a bunch of tasks in my flow. When one of the tasks fails, I need to restart the previous task and the flow should continue from that point as if nothing happened in the flow. Is it possible?
    k
    • 2
    • 16
  • p

    Payam Vaezi

    09/28/2021, 1:32 PM
    Hi, can a single Prefect kubernetes agent deploy jobs to different namespaces in the same kubernetes cluster?
    k
    • 2
    • 2
  • a

    Alfie

    09/28/2021, 3:40 PM
    Hi Team, I want to set up an environment with fast responding, and a cron scheduled flow should be executed right after the planned time point. Meanwhile the load maybe high sometimes, such as tens of flows to trigger in a second. Do you think Prefect can achieve the requirement? Or any suggestions about the deployment and settings? I want to just use local agent to execute the flows, of course there could be more than one agent instances. Thanks
    k
    • 2
    • 21
  • k

    Kevin Weiler

    09/28/2021, 9:32 PM
    hi there - I’m trying to get prefect server (which I have running on Nomad in a configuration that I essentially translated from the docker-compose file) to do two things: 1. return the correct URL for a flow that I’ve registered 2. return the correct URL for a flow that the
    slack_notifier
    function posts a status update for presumably these 2 things are related. I tried following this ticket and setting the
    PREFECT__SERVER__UI__ENDPOINT
    env var in the environment where the UI container runs. I believe that is what is implied by:
    [server]
      [server.ui]
      endpoint = "..."
    In the ticket. But that didn’t correct the issue. Do I need to set this env var in a different component - the graphql component perhaps?
    k
    • 2
    • 5
  • f

    Fanglin

    09/29/2021, 4:42 PM
    Hi all, I have a question regarding the prefect cloud authorization. I am using my account to create a team, with some users invited. Although other users have been authorized to use the cloud account, one user can create a key off her dashboard but cannot use the key when she run "prefect auth login --key <YOUR-KEY>" after she set the cloud as the backend. She gets the following error
    "unauthorized. invalid prefect cloud api key"
    Any ideas why?
    k
    • 2
    • 4
  • o

    Omer Sen

    09/30/2021, 6:56 AM
    Hello I am using 0.14.12 and cant get tenant id
  • o

    Omer Sen

    09/30/2021, 6:56 AM
    even if tenant is created with create-tenant job on k8s
  • o

    Omer Sen

    09/30/2021, 6:56 AM
    The following error messages were provided by the GraphQL server:
              
                INTERNAL_SERVER_ERROR: Variable "$input" got invalid value null at
                     "input.tenant_id"; Expected non-nullable type UUID! not to be null.
  • o

    Omer Sen

    09/30/2021, 6:56 AM
    and we get following error
    k
    • 2
    • 1
  • f

    Fabrice Toussaint

    09/30/2021, 7:32 AM
    Hi everyone, Does someone know if it is possible to dynamically set task tags? For example, I have two flow runs with different parameters (Flow A and Flow B) but I want Flow A to use up different Dask resources than Flow B. (The Flow is similar but only the parameters change, so the tasks will also be the same tasks for each Flow)
    k
    • 2
    • 1
  • d

    Dimas

    09/30/2021, 8:00 AM
    Hi, i'm new on prefect, i'm installing prefect on centos8 cloud server, i expect prefect can run with my public IP (not local host). i have set the config.toml
    [server]
    host = "<http://mypublicIP>"
    port = "4200"
    host_port = "4200"
    endpoint = "${server.host}:${server.port}"
        [server.ui]
        host = "<http://mypublicIP>"
        port = "8080"
        host_port = "8080"
        host_ip = "mypublicIP"
        endpoint = "${server.ui.host}:${server.ui.port}"
        apollo_url = "<http://mypublicIP:4200/graphql>"
    but some how, prefect come up with this err:
    ERROR: for tmp_ui_1  Cannot start service ui: driver failed programming external connectivity on endpoint tmp_ui_1 (1f380ce2f089ba70a8c422d2302bb447fef87c48bdd81d2dd93898b661c661a0): Error starting userland proxy: listen tcp4 xx.xx.xx.xx:8080: bind: cannot assign requested address
    but if i resetting the .toml file into local host. it's working with no error can any one give me a clue, on how prefect UI running with my public IP: this is my environment: • Python 3.6.8 • Docker version 20.10.8, build 3967b7d • docker-compose version 1.29.2, build unknown • docker-py version: 5.0.2 • CPython version: 3.6.8 • OpenSSL version: OpenSSL 1.1.1g FIPS 21 Apr 2020 • prefect version: 0.15.6
    k
    • 2
    • 1
  • a

    Alexander van Eck

    09/30/2021, 1:21 PM
    Does restarting server while flows are running interrupt those flows?
    k
    • 2
    • 1
  • v

    VildMedPap

    09/30/2021, 1:30 PM
    Hi Community 👋🏼 Me and my pal @Claus Vestergaard are facing a Docker challenge with Prefect. We have searched and read multiple questions and answers in this Slack team but we are still confused if our intended use case is applicable with Prefect. Case We have a Docker image with python code which process a csv file and return a json file (this is done through bind mounting)
    docker build my_processor .
    docker run -v ${PWD}/data:/app/data my_processor
    Here the raw data (the csv file) is located in /data/raw and the processed file (the json file) will be located by the container in /data/processed. What we wish to achieve - 3 tasks - Task #1) Fetch data from source (S3) and temporarily store it in /data/raw - Task #2) Run the container with bind mount to /data directory - Task #3) Push data from /data/processed to destination (S3) Our setup - The prefect server is hosted locally on an EC2 server Dockerfile used to build the image
    FROM python:3.7-slim
    WORKDIR /app
    COPY . .
    RUN pip install .
    CMD ["python3", "preprocess.py"]
    Skeleton for our Flow
    flow.py
    from prefect import Flow, task
    ...
    
    @task(name="Get data")
    def get_data_from_s3():
        """Retrieve csv from S3 and saves as /data/raw/file.csv"""
        pass
    
    
    @task(name="Process data")
    def process_through_docker_image():
        """Start docker container which
            - reads the csv-file
            - processes the data
            - writes as json
        """
        pass
    
    @task(name="Push data")
    def upload_to_s3():
        """Push data to S3"""
        pass
    
    with Flow("foo") as f:
        # First get data: get_data_from_s3()
        ...
    
        # Then process the data: process_through_docker_image()
        ...
    
        # Finally, upload the processed data to S3: upload_to_s3()
        ...
    
    f.register()
    Questions: 1. Is Prefect intended to be used this way? 2. Is it possible to use an already built Docker image in the way described above? 3. If so, how to do it? 😬
    k
    • 2
    • 11
  • w

    William Burdett

    09/30/2021, 4:14 PM
    Hey everyone, I have an issue. We're getting this error: "Unexpected error: ClientError(\'An error occurred (ThrottlingException) when calling the DescribeTasks operation (reached max retries: 4): Rate exceeded\')"
    I tried to bump the version of dask to 2021.9.1 and it is giving me back this error:
    ImportError: cannot import name 'apply' from 'dask.compatibility' (/usr/local/lib/python3.9/site-packages/dask/compatibility.py)
    I have no idea how to handle this
    k
    • 2
    • 15
  • j

    Julio Venegas

    09/30/2021, 5:53 PM
    Hi everyone! I upgraded to 15.6 and I’m struggling to connect to my external postgres instance. The postgres instance is an Azure managed one, the admin postgres username is automatically generated by azure in the form of INPUT_NAME@AZURE_INSTANCE_NAME which makes it impossible to use the command
    prefect server start --postgres-url postgres://<username>:<password>@hostname:<port>/<dbname>
    because the @ in the username makes the parsing process think that AZURE_INSTANCE_NAME is the host. Escaping the @ in the username has not worked. In the past the quick fix someone from the Prefect team recommended to me that actually solved the issue, was to install https://github.com/PrefectHQ/server, pass the postgres connection string to the prefect-server config with export PREFECT_SERVER__DATABASE__CONNECTION_URL=CONNECTION_STRING and then run
    prefect-server database upgrade
    . I’m currently doing 1)
    prefect server start --external-postgres --no-upgrade
    to start the Docker containers, followed by
    prefect-server database upgrade
    and the current error I’m getting from the last command is
    Error: HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /v1/query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6aaf865730>: Failed to establish a new connection: [Errno 111] Connection refused'))
    which based on the port=3000 is related to Hasura. Any advice highly appreciated!!
    k
    m
    • 3
    • 55
  • s

    Sam Werbalowsky

    09/30/2021, 8:34 PM
    anyone have luck setting
    PREFECT__ENGINE__EXECUTOR__DEFAULT_CLASS
    with dask-gateway? We use a dynamic cluster per flow, rather than static, so we can’t fill in an exact address, as it depends on the cluster that has spun up as part of the flow running. My goal is to have a helper file that configures the default executor and runconfig for a user so they don’t have to worry about their flow’s configuration.
    k
    • 2
    • 5
  • n

    Nivi Mukka

    09/30/2021, 10:37 PM
    Hello Team, I have Dask Gateway setup on a GKE cluster, which is being used as the executor for a Prefect Server. Versions:
    dask-gateway==0.9.0
    dask==2020.12.0
    distributed==2020.12.0
    prefect==0.14.1
    click==7.1.2
    Constantly seeing this warning on Dask worker logs after a data read from BigQuery. The data read from BigQuery is happening on 15 different workers but this warning shows up only on 2-3 workers and then the Prefect Flow takes about an hour to proceed from there. Any insight into how this can be resolved?
    k
    • 2
    • 13
  • t

    Thomas Fredriksen

    10/05/2021, 9:26 AM
    Hi everyone. I have a flow that required the
    gevent
    package.
    gevent
    will patch the SSL-library and requires the following lines to be added before
    ssl
    is imported in order to avoid an infinite import recursion:
    import gevent.monkey
    gevent.monkey.patch_all()
    I am trying to deploy my flow to a Prefect Server instance, but it seems I am not able to monkey-patch early enough, as I am seeing this infinite recursion error in one of my tasks. Is there any way of forcing the server to do this monkey-patch before executing the flow?
    k
    • 2
    • 6
  • s

    Scarlett King

    10/05/2021, 2:53 PM
    Hi, is there a way for my local agent to run flows that are stored on Azure Blob storage? I can see the flows are registered locally and stored on the blob storage but when I tried to run them, they are not started
    k
    • 2
    • 32
  • a

    Alejandro A

    10/05/2021, 5:10 PM
    H i have a question, I just deployed a flow on Preset using the CLI, which worked amazingly but I haven't seen how and when the dependencies (requierements) for that python flow were installed, how does this work or where can I find the documentation?
    k
    • 2
    • 12
  • u

    2j

    10/06/2021, 2:27 AM
    Hi all, is there a preferred way to pass along secrets / env vars to the helm deployment of prefect-server during a CI/CD pipeline? For more context, I'm trying to give the deployment a
    AZURE_STORAGE_CONNECTION_STRING
    for access to blob storage. I'm not seeing anything baked into the helm values.yaml (though maybe something in
    prefectConfig
    could work?). I was thinking of attaching a k8s secret after the helm deployment? But I think it needs to be set on the job that the agent kicks off. And I should be able to set the env var as-is, or in secret form like
    PREFECT__CONTEXT__SECRETS__AZURE_STORAGE_CONNECTION_STRING
    ?
    t
    • 2
    • 10
  • d

    Denis Rogovskiy

    10/06/2021, 11:18 AM
    Hi! I up prefect server in docker locally with version "core-0.15.2" it starts normally, but the when i try to up agent , got error : "prefect.exceptions.ClientError: Your Prefect Server instance has no tenants. Create a tenant with `prefect server create-tenant`". Found that, if I use folder with postgres data, that was created with older version of server, agent up as normal. Сan anybody help, what happens?
    k
    m
    • 3
    • 11
  • a

    Aleksandr Glushko

    10/06/2021, 3:03 PM
    Hi, all! Could anyone advise, how to make the flow python file stored in GitHub repo, use some packages stored in the same folder? So, for example:
    github_repo/
    ├── flow.py
    ├── flow_dependencies/sub_task.py
    how can one
    import flow_dependencies.saubtask
    in
    flow.py
    if i use
    flow.storage = Git(...)
    k
    m
    • 3
    • 3
  • t

    TOMAS IGNACIO ACUÑA RUZ

    10/06/2021, 3:10 PM
    Hi Everyone, I want to extract the summary value of Prefect UI, is there any way to do it using the python API? Is for a external report for SLA references.
    k
    • 2
    • 7
  • s

    Scarlett King

    10/06/2021, 3:25 PM
    Hey, I’m trying to use Kubernetes agent locally instead of local agent. I have a customised Docker image that I built locally that I want Kubernetes to use. How do I tell the Kubernetes agent to do this? It looks like if I just pass the name of the image, the agent is saying it can’t find it.
    k
    • 2
    • 14
  • t

    Tonin Gega

    10/06/2021, 4:29 PM
    Hey guys, I’ve got Prefect running in a GCE VM, I’ve configured my config.toml locally so that I can register my flow to the remote VM and then run from the front end. I’m getting this error: 
    Failed to load and execute Flow's environment: ModuleNotFoundError("No module named '/Users/tonin'")
     not really sure what i’m missing, that’s not a module in my flow. If I register my flow from within the VM the flow runs fine.
    k
    m
    • 3
    • 3
Powered by Linen
Title
t

Tonin Gega

10/06/2021, 4:29 PM
Hey guys, I’ve got Prefect running in a GCE VM, I’ve configured my config.toml locally so that I can register my flow to the remote VM and then run from the front end. I’m getting this error: 
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named '/Users/tonin'")
 not really sure what i’m missing, that’s not a module in my flow. If I register my flow from within the VM the flow runs fine.
k

Kevin Kho

10/06/2021, 4:37 PM
Hey @Tonin Gega, reading this will clear things up
m

Marco Fontana

10/07/2021, 12:45 PM
Hello @Kevin Kho thank you for your answer 🙂 I work with Tonin. The reason we asking is because few days ago we were able to register a flow from local laptop to the server and run it from there. Is what I just described an actual scenario that can happen with certain configuration or are we completely wrong? Thanks for your help 🙂
k

Kevin Kho

10/07/2021, 1:56 PM
You just want to use a storage class (Github, S3) that can be pulled from both locations, and then it will work
View count: 1