OK, it is solved. I will update later, need a brea...
# prefect-ui
k
OK, it is solved. I will update later, need a break now.
j
Thanks for keeping us updated. Please do come back and share so that others can benefit from it too!
gratitude thank you 1
šŸ‘ 2
k
Now I tried to give an explanation in this issue that I already mentioned before: https://github.com/PrefectHQ/prefect/issues/5648#issuecomment-1217944604
In a docker setup there can be different IPs, domain names port numbers involved and not everything is localhost:4200.
Orion does not warn the user when it cannot reach the backend, I think it should but maybe they have their reasons. On the other hand, a small overlay telling the user 'cannot reach backend at 127.0.0.1:4200' would not harm anybody
j
Thanks for the suggestion @kwmiebach - I think we could add some sort of warning - I'll open a ticket but if you could any detail and more info about your use case and experience, that would be great,
@Marvin open "Add a warning to be shown in the UI if it cannot reach a backend"
e
not sure if it would help, but Iā€™m pretty sure
prefect profiles
can help here. When you run if you define your backend variable in a profile, when you use
prefect profile use YOUR_PROFILE_NAME
it will try to establish a connection and report back the status
s
@kwmiebach I'm still struggling to get Orion to output anything from it's backend. I think I'm having the same issues as you. Would you be able to post a full docker compose yaml that you used? Your post on the github thread doesn't include the whole thing and I'm fairly new to docker!
k
@Sam Pibworth sorry I did not get back to your question, I had the slack client closed because I was working on other projects. I will post a working docker-compose file
Copy code
version: "3.7"
services:

    orion:
        container_name: orion
        image: prefecthq/prefect:2.0.4-python3.7
        #image: prefecthq/prefect:2.0b6-python3.10
        ports:
        - 4208:4200
        environment:
            PREFECT_ORION_API_HOST: 127.0.0.1
            PREFECT_ORION_API_PORT: 4200
            #PREFECT_API_URL: <http://0.0.0.0:4200/api>
            PREFECT_ORION_UI_API_URL: <http://pc5:4208/api>
        command: prefect orion start --host 0.0.0.0 --port 4200
        #command: tail -f /dev/random >> /dev/null

    cisextract:
        container_name: cisextract
        image: <http://registry.gitlab.com/hbs-team/intranet/mp24-intranet/cisextract:latest|registry.gitlab.com/hbs-team/intranet/mp24-intranet/cisextract:latest>
        user: 1000:1000
        ports:
        - 8007:8000/tcp
        - 3007:3000/tcp
        - 4207:4200
        depends_on:
        - orion
        environment:
            PREFECT_API_URL: <http://orion:4200/api>
        volumes:
        - ./arzt:/app
        - ../cistransform/cache:/cache
        - ./prefect:/home/webroot/.prefect
        command: tail -f /dev/random >> /dev/null
    redcisload:
        container_name: redcisextract
        image: <http://registry.gitlab.com/hbs-team/intranet/mp24-intranet-red/red:latest|registry.gitlab.com/hbs-team/intranet/mp24-intranet-red/red:latest>
        ports:
        - 1870:1880/tcp
        depends_on:
        - cisextract
        volumes:
        - ./red/data:/data
        - ./red/.ssh:/usr/src/node-red/.ssh
        - /var/sambashare:/sambashare
Some explanations: This is an unedited and working docker compose file. It contains stuff that is not required for you in this context. Especially the 3rd service 'redcisload' is not necessary and it does not use orion or prefect.
The first service is orion with some environment vars. Note that pc5:4208/ is what I put into my browser addressline to access orion in the browser. This means the machine that runs the browser must be able to resolve pc5 to the IP of the docker host. I use the /etc/hosts file on that machine to do this.
The second service cisextract is where I am running some flows. It has python installed and prefect 2.x.
@Sam Pibworth sorry again for the late reply, maybe it still helps you or someone else. Ah, and the docker images from the gitlab are not public, it is basically a standard debian/python image with our software installed in it.
The name resolution between the containers is also noteworthy. In the environment section of cisextract there is an entry that uses 'orion' as a hostname. At runtime docker resolves this to the IP of the orion container, which the cissextract container can access. This IP can be different each time. I have the same line in the orion container, but I am not sure it is needed there, so I commented it and it still seems to work.
s
@kwmiebach Thanks so much for this! Super helpful šŸ™‚