### Install UDX Worker CLI Source: https://udx.dev/worker/index Installs the UDX Worker deployment CLI globally using npm. This is a one-time setup on your local machine. ```bash npm install -g @udx/worker-deployment ``` -------------------------------- ### Run UDX Worker deployment Source: https://udx.dev/worker/index Executes the UDX Worker deployment based on the configuration in the `deploy.yml` file. This command starts the container. ```bash worker run ``` -------------------------------- ### Run Deployment with Child Image Config Source: https://udx.dev/worker/index Executes a UDX worker deployment using a configuration file specifically created for a child image, applying the resolved settings to start the service. ```bash worker run --config=child.deploy.yml ``` -------------------------------- ### Preview UDX Worker deployment Source: https://udx.dev/worker/index Performs a dry run of the worker deployment to preview the command that will be executed. This is a safe check before starting the container. ```bash worker run --dry-run ``` -------------------------------- ### Generate Child Image Deploy Configuration Source: https://udx.dev/worker/index Generates a `deploy.yml` configuration file tailored for child UDX worker images (e.g., Node.js, PHP), simplifying setup for language-specific tooling. ```bash worker config --output=child.deploy.yml ``` -------------------------------- ### List Available Worker Images Source: https://udx.dev/worker/index Displays all available UDX worker base and child images, helping users select the appropriate image for their workload. ```bash worker images --all ``` -------------------------------- ### Sign in to Google Cloud Source: https://udx.dev/worker/index Logs into your Google Cloud account using the gcloud CLI. This is a prerequisite for setting up application default credentials. ```bash gcloud auth login ``` -------------------------------- ### Kubernetes Deployment with Worker Configuration Source: https://udx.dev/worker/index Illustrates a Kubernetes deployment pattern for UDX workers, showing how to mount configuration via ConfigMap and set environment variables, including cloud provider references for secrets. ```yaml # Kubernetes deployment pattern spec: serviceAccountName: worker-runtime containers: - name: worker volumeMounts: - name: worker-config mountPath: /home/udx/.config/worker env: - name: ES_PASSWORD value: "gcp/staging-project/es-password" volumes: - name: worker-config configMap: name: worker-runtime-config ``` -------------------------------- ### Configure UDX Worker runtime services Source: https://udx.dev/worker/index Defines supervised services and their command startup contracts in the `services.yaml` file. Each service has a name, command, and autostart/autorestart settings. ```yaml # /home/udx/.config/worker/services.yaml kind: workerService version: udx.io/worker-v1/service services: - name: "api" command: "bash -lc 'exec /home/udx/bin/start-api.sh'" autostart: true autorestart: true envs: - "PORT=8080" - "SERVICE_NAME=api" - name: "scheduler" command: "bash -lc 'exec /home/udx/bin/run-scheduler.sh --interval=60'" autostart: true autorestart: true ``` -------------------------------- ### Dry Run Deployment with Child Image Config Source: https://udx.dev/worker/index Performs a dry run of a UDX worker deployment using a configuration file generated for a child image, allowing preview of the execution without starting the service. ```bash worker run --config=child.deploy.yml --dry-run ``` -------------------------------- ### Define secret references in worker.yaml Source: https://udx.dev/worker/index Specifies secret references in `worker.yaml` for portability. Deployment environment variables can override these values. Example shows a GCP secret reference. ```yaml # /home/udx/.config/worker/worker.yaml kind: workerConfig version: udx.io/worker-v1/config config: secrets: DB_PASSWORD: "gcp/my-project/db-password" ``` -------------------------------- ### Minimal Worker Deploy Configuration Source: https://udx.dev/worker/index Defines the basic configuration for deploying a UDX worker, including the container image, volume mounts for configuration, and the command to run. ```yaml kind: workerDeployConfig version: udx.io/worker-v1/deploy config: image: "usabilitydynamics/udx-worker:latest" volumes: - "./.config/worker:/home/udx/.config/worker:ro" command: "worker" args: - "service" - "list" ``` -------------------------------- ### Accessing Running Container Shell Source: https://udx.dev/worker/index Provides the command to open a shell within a running UDX worker container for direct interaction and troubleshooting. ```bash worker run run-it ``` -------------------------------- ### List UDX Worker services Source: https://udx.dev/worker/index Lists the services managed by the UDX Worker within a running container. This command helps in inspecting the status of services. ```bash worker service list ``` -------------------------------- ### Create/update Google Cloud application default credentials Source: https://udx.dev/worker/index Sets up application default credentials for gcloud, enabling the CLI to authenticate with Google Cloud services using short-lived credentials. ```bash gcloud auth application-default login ``` -------------------------------- ### Generate deploy.yml with UDX Worker CLI Source: https://udx.dev/worker/index Generates a template `deploy.yml` file in the current directory. This file is used to configure deployment settings, including image and mounts. ```bash worker config ``` -------------------------------- ### Set service account for local keyless auth Source: https://udx.dev/worker/index Configures the service account email in `deploy.yml` for local keyless authentication. This allows the CLI to use short-lived credentials. ```yaml service_account: email: "worker-sa@my-project.iam.gserviceaccount.com" ``` -------------------------------- ### Check UDX Worker authentication status Source: https://udx.dev/worker/index Verifies the authentication status of the UDX Worker, outputting the information in JSON format. This helps in debugging authentication issues. ```bash worker auth status --format json ``` -------------------------------- ### Stream Specific Service Logs Source: https://udx.dev/worker/index Allows streaming logs for a particular UDX worker service, with options to specify the number of recent lines to display and to continuously follow new logs. ```bash worker service logs --tail 100 --follow ``` -------------------------------- ### Configure UDX Worker runtime environment and secrets Source: https://udx.dev/worker/index Defines runtime environment variables and secret references in the `worker.yaml` file. Secrets use provider references like `aws/db-password/us-west-2`. ```yaml # /home/udx/.config/worker/worker.yaml kind: workerConfig version: udx.io/worker-v1/config config: env: LOG_LEVEL: "info" secrets: DB_PASSWORD: "aws/db-password/us-west-2" API_KEY: "azure/kv-prod/api-key" SERVICE_TOKEN: "gcp/my-project/service-token" ``` -------------------------------- ### Stream UDX Worker service logs Source: https://udx.dev/worker/index Streams logs from a specific UDX Worker service (e.g., 'firebase') inside the container. It allows tailing the last 100 lines and following new logs in real-time. ```bash worker service logs firebase --tail 100 --follow ``` -------------------------------- ### Resolve a UDX Worker environment variable reference Source: https://udx.dev/worker/index Resolves a specific environment variable reference (e.g., a GCP secret token) within the UDX Worker environment. This command helps verify secret resolution. ```bash worker env resolve gcp/my-project/service-token ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.