Prism
v0.2.2
v0.2.2
  • 👋Welcome to Prism!
  • Getting Started
    • Installation
    • Creating your first project
    • Why Prism?
  • Fundamentals
    • Tasks
      • tasks
        • tasks.ref()
      • hooks
        • hooks.sql
        • hooks.spark
        • hooks.dbt_ref
        • hooks.get_connection
        • hooks.get_cursor
    • Targets
      • Multiple targets
    • Config files
      • prism_project.py
        • RUN_ID / SLUG
        • SYS_PATH_CONF
        • THREADS
        • PROFILE_YML_PATH / PROFILE
        • PRISM_LOGGER
        • TRIGGERS_YML_PATH / TRIGGERS
      • Profile YML
      • Triggers YML
    • Jinja
      • __file__ and Path
      • prism_project
      • wkdir
      • parent_dir
      • concat
      • env
  • Adapters
    • Overview
    • sql
      • BigQuery
      • Postgres
      • Redshift
      • Snowflake
      • Trino
      • Presto
    • PySpark
    • dbt
  • Agents
    • Overview
    • Docker
    • EC2
  • CLI
    • Command Line Interface
    • agent
      • apply
      • run
      • build
      • delete
    • compile
    • connect
    • create
      • agent
      • task
      • trigger
    • graph
    • init
    • run
    • spark-submit
  • Advanced features
    • Concurrency
    • Logging
    • Triggers
    • Retries
    • Python Client
  • API Reference
    • prism.task.PrismTask
    • @task(...)
    • @target(...)
    • @target_iterator(...)
    • TaskManager
      • tasks.ref(...)
    • PrismHooks
      • hooks.sql(...)
      • hooks.dbt_ref(...)
      • hooks.get_connection(...)
      • hooks.get_cursor(...)
    • prism.target.PrismTarget
  • Use Cases
    • Analytics on top of dbt
    • Machine Learning
  • Wiki
    • DAGs
Powered by GitBook
On this page
  • Usage
  • Example
  1. CLI
  2. create

agent

Usage

prism create agent is used to create an agent YML configuration file.

 Usage: prism create agent [OPTIONS]                                                                                                 
                                                                                                                                     
 Create an agent YML configuration file                                                                                              
                                                                                                                                     
 Examples:                                                                                                                           
                                                                                                                                     
  • prism create agent --type docker                                                                                                 
  • prism create agent --type ec2 --file ./agents/ec2.yml                                                                            
                                                                                                                                     
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --type       -t  [docker|ec2]             Agent type                                                                           │
│                                              [required]                                                                           │
│    --file       -f  TEXT                     File path for agent YML configuration. Default is ./agent.yml.                       │
│    --log-level  -l  [info|warn|error|debug]  Set the log level                                                                    │
│    --full-tb                                 Show the full traceback when an error occurs                                         │
│    --help                                    Show this message and exit.                                                          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Here's what prism create agent does under the hood:

  1. Checks whether the YML file specified with option -f, --file exists.

    • If it doesn't, it creates a new YML file with the configuration for agent type --type.

    • If it does, it throws an error. Each agent must live in their own YML file.

Example

Here's what the output looks like in Terminal:

$ prism create agent --type docker -f ./docker_agent.yml
--------------------------------------------------------------------------------
<HH:MM:SS> | INFO  | Running with prism v0.2.2...
<HH:MM:SS> | INFO  | Found project directory at /Users/my_first_project
 
<HH:MM:SS> | INFO  | RUNNING EVENT 'parsing prism_project.py'................................................ [RUN]
<HH:MM:SS> | INFO  | FINISHED EVENT 'parsing prism_project.py'............................................... [DONE in 1.34s]
 
<HH:MM:SS> | INFO  | Creating docker_agent.yml...
 
<HH:MM:SS> | INFO  | Done!
--------------------------------------------------------------------------------

After this command executes, the following file will be added to your project directory.

# docker_agent.yml

agent:
  type: docker
  image: <base image>
  server_url:  # URL to the docker server
  requirements:  # path to requirements.txt, relative to this file
  env:
    <your environment variable here>: '<your environment variable value'

PreviouscreateNexttask

Last updated 1 year ago