<@ULVA73B9P> I have around 50 deployments, some ar...
# ask-marvin
a
@Marvin I have around 50 deployments, some are scheduled some are not. How do I set a good naming convention to get a good overview of what is going on? Can you give me concrete examples
m
thought for 47.9 seconds
Here's a comprehensive guide for organizing your deployments with effective naming conventions: ### Recommended Naming Pattern
Copy code
{domain}/{flow-name}-{environment}-{schedule-type}
### Concrete Examples: 1. For Scheduled Deployments:
Copy code
python
"etl/customer-data-sync-prod-daily"
"reporting/sales-metrics-prod-hourly"
"monitoring/health-check-prod-5min"
2. For Non-Scheduled (Ad-hoc) Deployments:
Copy code
python
"etl/customer-data-sync-prod-adhoc"
"reporting/sales-metrics-dev-manual"
3. For Different Environments:
Copy code
python
"etl/inventory-update-dev-daily"
"etl/inventory-update-staging-daily"
"etl/inventory-update-prod-daily"
### Best Practices: 1. Use Forward Slashes (/) for Grouping: - Creates visual hierarchy in the UI - Makes it easier to filter and search - Example:
marketing/
,
finance/
,
data-science/
2. Include Essential Components: - Domain/Category (e.g., etl, ml, reporting) - Flow name (descriptive but concise) - Environment (dev, staging, prod) - Schedule type (daily, hourly, adhoc) 3. Use Consistent Separators: - Hyphens (-) between components - Forward slashes (/) for hierarchy - Avoid spaces and special characters 4. Include Schedule Frequency in Name: - For scheduled deployments: hourly, daily, weekly, 5min - For non-scheduled: adhoc, manual ### Implementation Example:
Copy code
python
from prefect import flow

@flow(name="customer-data-sync")
def sync_customer_data():
    # your flow code here
    pass

# Deploy with descriptive name
flow.from_source(
    source="<https://github.com/your-repo>",
    entrypoint="flows/customer_sync.py:sync_customer_data"
).deploy(
    name="etl/customer-data-sync-prod-daily",
    work_pool_name="prod-pool",
    schedule={"interval": "24:00:00"}
)
### Additional Tips: - Keep names under 50 characters for readability - Use lowercase letters to avoid case-sensitivity issues - Include the schedule interval in the name for quick identification - Group related flows under the same domain prefix This naming convention will help you: - Quickly identify the purpose of each deployment - Filter and search effectively in the UI - Understand which deployments are scheduled vs. ad-hoc - Maintain organization as your deployment count grows For more details on deployment management, you can refer to the Prefect deployments documentation.
a
@Marvin Suddenly your suggestion of using forward slashes for grouping gave me the following error: Expected format: FLOW_NAME/DEPLOYMENT_NAME
m
thought for 37.0 seconds
Let me provide the correct naming convention that follows Prefect's required format: ### Correct Format:
Copy code
<FLOW_NAME>/<DEPLOYMENT_NAME>
### Concrete Examples: 1. For Scheduled Deployments:
Copy code
python
"customer-data-sync/prod-daily"
"sales-metrics/prod-hourly"
"health-check/prod-5min"
2. For Non-Scheduled (Ad-hoc) Deployments:
Copy code
python
"customer-data-sync/prod-adhoc"
"sales-metrics/dev-manual"
3. For Different Environments:
Copy code
python
"inventory-update/dev-daily"
"inventory-update/staging-daily"
"inventory-update/prod-daily"
### Implementation Example:
Copy code
python
from prefect import flow

@flow(name="customer-data-sync")
def sync_customer_data():
    # your flow code here
    pass

# Deploy with correct naming format
flow.from_source(
    source="<https://github.com/your-repo>",
    entrypoint="flows/customer_sync.py:sync_customer_data"
).deploy(
    name="customer-data-sync/prod-daily",  # Correct format
    work_pool_name="prod-pool",
    schedule={"interval": "24:00:00"}
)
### Best Practices for Naming: 1. Flow Name (Before the /): - Keep it descriptive and specific - Use hyphens for word separation - Examples:
customer-data-sync
,
sales-metrics
,
ml-training
2. Deployment Name (After the /): - Include environment: dev, staging, prod - Include schedule type: daily, hourly, adhoc - Examples:
prod-daily
,
dev-adhoc
,
staging-hourly
3. Consistent Naming Pattern:
Copy code
<descriptive-flow-name>/<environment>-<schedule-type>
4. Use Hyphens (-) for Word Separation: - Avoid spaces and special characters - Keep everything lowercase - Example:
data-ingestion/prod-daily
This naming convention will help you: - Comply with Prefect's required format - Easily identify flow purpose and deployment type - Maintain consistency across your deployments - Quickly understand which environment and schedule type each deployment uses For more information about deployments, you can refer to the Prefect deployments documentation.
a
@Marvin Show me what it looks like when grouping in the UI
m
thought for 47.0 seconds
In Prefect 3.x, the UI organizes deployments based on the flow name, which appears as the primary grouping mechanism. Let me show you how different naming approaches affect the UI organization: ### Example 1: Basic Organization
Copy code
Flow Name / Deployment Name
------------------------
data-ingestion / prod-daily
data-ingestion / dev-daily
data-ingestion / staging-daily
In the UI, these would be grouped under "data-ingestion" with three deployments listed beneath it. ### Example 2: Related Flows
Copy code
Flow Name / Deployment Name
------------------------
customers-etl / prod-daily
customers-etl / prod-hourly
customers-api / prod-daily
customers-api / dev-daily
These would appear as two distinct groups in the UI: - "customers-etl" group (2 deployments) - "customers-api" group (2 deployments) ### Example 3: Domain-Based Organization
Copy code
Flow Name / Deployment Name
------------------------
marketing-email-sync / prod-daily
marketing-analytics / prod-daily
finance-reports / prod-weekly
finance-metrics / prod-daily
These would be organized as: - "marketing-email-sync" group - "marketing-analytics" group - "finance-reports" group - "finance-metrics" group ### Best Practices for UI Organization: 1. Use Consistent Prefixes in Flow Names:
Copy code
marketing-* / deployment-name
finance-* / deployment-name
etl-* / deployment-name
This creates visual grouping of related flows in the UI. 2. Clear Environment Separation in Deployment Names:
Copy code
customer-sync / prod-daily
customer-sync / staging-daily
customer-sync / dev-daily
This makes it easy to identify different environments for the same flow. 3. Schedule Type Visibility:
Copy code
metrics-collection / prod-5min
metrics-collection / prod-hourly
metrics-collection / prod-daily
This clearly shows different schedules for the same flow. The UI will automatically: - Group all deployments under their respective flow names - Show schedule information for each deployment - Display the status of each deployment - Provide quick access to deployment details and run history Remember: - The flow name (before the /) is your primary organizational tool - Use consistent naming patterns for both flow names and deployment names - You can filter and search based on both flow names and deployment names in the UI - The UI will preserve this hierarchy when displaying logs, run history, and other details This organization makes it easier to: - Find specific deployments quickly - Monitor related deployments together - Manage environments effectively - Track scheduled vs. ad-hoc deployments For the best experience, maintain consistency in your naming convention across all your flows and deployments. This will make the UI more intuitive and easier to navigate as your deployment count grows.
a
@Marvin I want you to send me pictures of what it would look like in the UI
m
thought for 6.0 seconds
I apologize, but I don't have the ability to send, generate, or manipulate images. I can only provide text-based responses and interact with the provided tools. The best way to see exactly how deployments look in the UI would be to: 1. Visit your Prefect UI directly at your server address (typically
<http://localhost:4200>
for local installations) 2. Check the official Prefect documentation with UI screenshots at https://docs-3.prefect.io/ 3. Visit the Prefect Cloud UI if you're using Prefect Cloud If you need visual references, I'd recommend: 1. Creating a few test deployments with different naming patterns to see how they appear in your own UI 2. Checking the official Prefect documentation 3. Asking in the Prefect community Slack channel where users can share screenshots Would you like me to provide more specific information about any particular aspect of the UI organization that you're interested in?