David
10/18/2024, 6:50 PMMarvin
10/18/2024, 6:50 PM--job-variable
with Prefect 3.x, you should define this in your prefect.yaml
file under the job_variables
section. This section allows you to specify environment variables or other job-specific configurations that will be applied when deploying your flows.
Here's a simplified example of how you could set up your prefect.yaml
to include a working directory:
yaml
deployments:
- name: demo-deployment
entrypoint: demo_project/demo_flow.py:some_work
work_pool:
name: local
job_variables:
env:
WORKING_DIRECTORY: /path/to/your/working/directory
schedule: null
In this example, WORKING_DIRECTORY
is set as an environment variable. You can specify this when running the deployment command, ensuring your working directory is set accordingly:
bash
prefect deploy -n demo-deployment
Make sure that the WORKING_DIRECTORY
environment variable is appropriately used in your code to change the directory, if needed.
For more detailed information, you can check the Prefect 3.x documentation on customizing deployments.
This approach ensures that your specified working directory is considered during the deployment process.Nate
10/18/2024, 6:51 PMprefect deploy .... -jv working_dir=some/path/etc
David
10/18/2024, 6:51 PMNate
10/18/2024, 6:51 PMDavid
10/18/2024, 7:02 PMNate
10/18/2024, 7:11 PMDavid
10/18/2024, 7:13 PM- name: Deploy flows
id: flow-time
run: |
pip install --upgrade pip
pip install prefect
FLOW_NAME=$(basename ${{ matrix.flows }} .py)
prefect deploy -n $POOL-base-deployment -t $POOL -p ecs-$POOL-pool -jv working_dir=opt/prefect/prefect ${{ matrix.flows }}:$FLOW_NAME
echo "flow_manifest=$FLOW_NAME.yaml" >> $GITHUB_ENV
how would I augment that pull stepNate
10/18/2024, 7:13 PMDavid
10/18/2024, 7:13 PMNate
10/18/2024, 7:15 PMprefect.yaml
- you might have a pull
step defined at the top of the file that is globally applying to all deployments defined in that file? if you dont want that, you may want to set pull: null
for each of the deployments it should not apply to, or remove it entirely and only specify it on deployments you needDavid
10/18/2024, 7:16 PMgiphy
10/18/2024, 7:23 PMNate
10/18/2024, 7:24 PM