m

    matta

    1 year ago
    #RubberDucking So I've got my Agents running on a small server, mostly triggering Google Cloud Functions and Cloud Run jobs. Trying to think of a CI/CD process that'll make it easy to register flows. There's probably a GitHub Action that automatically uploads new commits to a server? And then have the scripts call
    flow.register()
    at the bottom. probably a way to have it run
    flow.py
    upon uploading a new version?
    the important thing is being able to just have a nice feedback loop of "commit -> build -> check" instead of having to fuss around with ssh-ing into the server.
    Michael Adkins

    Michael Adkins

    1 year ago
    I would recommend using the
    prefect register
    CLI in a Github Action. You can also use
    Github
    or
    Git
    storage to point to commits which should make it pretty frictionless.
    I would not recommend calling
    flow.register()
    manually, the CLI can do a lot of heavy lifting.
    m

    matta

    1 year ago
    Ooh, awesome, thanks!
    s

    Spencer

    1 year ago
    If you do call it manually, you can use
    idempotency_key=flow.serialized_hash()
    so a flow isn't registered over itself if nothing changed. I also take it a step further where open PRs get registered into a separate project (with
    set_schedule_active=False
    ) so you can trial run the flows that are on a PR.
    Michael Adkins

    Michael Adkins

    1 year ago
    The newest CLI does that by default
    (not the schedules, there's an open ticket to add a flag for that)
    That's a good design choice though Spencer!
    s

    Spencer

    1 year ago
    A lot of the machinery I have in place is due to setting this up prior to
    0.13
    , so the build script does a bunch more like dynamically creating task environments which aren't needed anymore 😅 One day we'll upgrade to the new RunConfigs.
    Michael Adkins

    Michael Adkins

    1 year ago
    Get upgrading 😛, we almost dropped environments in 0.15.0 but we're leaving it til 0.16
    m

    matta

    1 year ago
    Yeah, I'd like to automatically put feature branches into a
    Testing
    project.
    Hrm, if it knows not to re-register flows that haven't changed maybe a monorepo for all the Flows would make sense?