Note that in version 1.4.0 the syntax for certain commands has changed. Check out the release notes and the description of the updated commands on this page.
The following commands refer to bacalhau cli version v1.4.0. For installing or upgrading a client, follow the instructions in the installation page. Run bacalhau version in a terminal to check what version you have.
Let’s run the bacalhau help command in the terminal to find out information about available commands and flags:
Compute over data
Usage:
bacalhau [command]
Available Commands:
agent Commands to query agent information.
completion Generate the autocompletion script for the specified shell
config Interact with the bacalhau configuration system.
devstack Start a cluster of bacalhau nodes for testing and development
docker Run a docker job on the network (see run subcommand)
exec Execute a specific job type
help Help about any command
job Commands to submit, query and update jobs.
node Commands to query and update nodes information.
serve Start the bacalhau compute node
version Get the client and server version.
wasm Run and prepare WASM jobs on the network
Flags:
--api-host string The host for the client and server to communicate on (via REST).
Ignored if BACALHAU_API_HOST environment variable is set. (default "bootstrap.production.bacalhau.org")
--api-port int The port for the client and server to communicate on (via REST).
Ignored if BACALHAU_API_PORT environment variable is set. (default 1234)
--cacert string The location of a CA certificate file when self-signed certificates
are used by the server
-h, --help help for bacalhau
--insecure Enables TLS but does not verify certificates
--log-mode logging-mode Log format: 'default','station','json','combined','event' (default default)
--repo string path to bacalhau repo (default "/home/u/.bacalhau")
--tls Instructs the client to use TLS
Use "bacalhau [command] --help" for more information about a command.
Global flags
--api-host string
Determines the host for RESTful communication between the client and server. This flag is ignored if the BACALHAU_API_HOST environment variable is set.
Default: bootstrap.production.bacalhau.org
--api-port int
Determines the port for RESTful communication between the client and server. This flag is ignored if the BACALHAU_API_PORT environment variable is active.
Default: 1234
--log-mode logging-mode
Determines the preferred log format. Available log formats are: default, station, json, combined, event.
Default: default
--repo string
Specifies the path to the bacalhau repository.
Default: $HOME/.bacalhau
The bacalhau agent command is a parent command that offers sub-commands to query information about the Bacalhau agent. This can be useful for debugging, monitoring, or managing the agent's behavior and health.
The bacalhau agent alive command retrieves the agent's liveness and health information. This can be helpful to determine if the agent is running and healthy.
Flags:-h,--helphelpforalive--outputformatTheoutputformatforthecommand (one of ["json""yaml"]) (defaultyaml)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.
--output format
Determines the format in which the output is displayed. Available formats include JSON and YAML. Default: yaml
--pretty
Formats the output for enhanced readability. This flag is relevant only when using JSON or YAML output formats.
The bacalhau agent node command gathers the agent's node-related information. This might include details about the machine or environment where the agent is running, available resources, supported engines, etc.
Flags:-h,--helphelpfornode--outputformatTheoutputformatforthecommand (one of ["json""yaml"]) (defaultyaml)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.
The bacalhau agent version command is used to obtain the version of the bacalhau agent.
Flags:-h,--helphelpforversion--outputformatTheoutputformatforthecommand (one of ["json""yaml"])--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.
To load completions in your current shell session:
bacalhau completion fish | source
To load completions for every new session, execute once:
bacalhau completion fish > ~/.config/fish/completions/bacalhau.fish
You will need to start a new shell for this setup to take effect.
To load completions in your current shell session:
bacalhau completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command to your powershell profile.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
The bacalhau config command is a parent command that offers sub-commands to modify and query information about the Bacalhau config. This can be useful for debugging, monitoring, or managing the nodes configuration.
The bacalhau config auto-resources command automatically configures compute resource values in the bacalhau node's configuration file based on the hardware resources of the user's machine. This command streamlines the process of resource allocation for jobs, dynamically adjusting settings to align with the capabilities of the machine. It is designed to simplify the task of resource management, ensuring that the node operates efficiently and effectively within the hardware's limits.
The bacalhau config auto-resources command intelligently adjusts resource allocation settings based on the specific hardware configuration of your machine, promoting optimal utilization for bacalhau jobs. Due to the dynamic nature of this command, the specific values set in the configuration will vary depending on the available hardware resources of the machine in use. This functionality is particularly beneficial for users who seek to optimize their node's performance without the need for manual calculations of resource limits. It is important for users to understand that these settings will directly impact the number and types of jobs their node can manage at any given time, based on the machine's resource capacity.
Flags:--default-job-percentageintPercentageexpressedasanumberfrom1to100representingdefaultperjobamountofresourcesjobswillgetwhentheydon't specify any resource limits themselves (values over 100 will be rejected (default 75) --job-percentage int Percentage expressed as a number from 1 to 100 representing per job amount of resource the system can be using at one time for a single job (values over 100 will be rejected) (default 75) --total-percentage int Percentage expressed as a number from 1 to 100 representing total amount of resource the system can be using at one time in aggregate for all jobs (values over 100 will be rejected) (default 75)
The bacalhau config list command lists the configuration keys and values of the bacalhau node. This command is useful for understanding how configuration keys map to their respective values, aiding in the use of the bacalhau config set command.
Configuration values displayed by this command represent the settings that will be applied when the bacalhau node is next restarted. It is important to note that these values may not reflect the current operational configuration of an active bacalhau node. The displayed configuration is relevant and accurate for a node that is either not currently running or that has been restarted after the execution of this command.
The bacalhau config set command sets a value in the bacalhau node's configuration file. This command is used to modify the configuration file that the bacalhau node will reference for its settings. Key names in the configuration are case-insensitive. Additionally, the command validates the value being set based on the type of the configuration key, ensuring that only appropriate and valid configurations are applied.
Changes made using this command will be applied to the configuration file, but they do not immediately affect the running configuration of an active bacalhau node. The modifications will take effect only after the node is restarted.
The bacalhau devstack command is used to start a cluster of nodes and run a job on them.
Usage:
bacalhaudevstack [flags]
Flags:
--Noop Use the noop executor for all jobs
--allow-listed-local-paths strings Local paths that are allowed to be mounted into jobs. Multiple paths can be specified by using this flag multiple times.
--autocert string Specifies a host name for which ACME is used to obtain a TLS Certificate.
Using this option results in the API serving over HTTPS
--bad-compute-actors int How many compute nodes should be bad actors
--bad-requester-actors int How many requester nodes should be bad actors
--compute-nodes int How many compute only nodes should be started in the cluster (default 3)
--cpu-profiling-file string File to save CPU profiling to
--default-job-execution-timeout duration default value for the execution timeout this compute node will assign to jobs with no timeout requirement defined. (default 10m0s)
--default-publisher string A default publisher to apply to all jobs without a publisher
--disable-engine strings Engine types to disable
--disable-storage strings Storage types to disable
--disabled-publisher strings Publisher types to disable
--docker-manifest-cache-duration duration The default time-to-live for each record in the manifest cache (default 1h0m0s)
--docker-manifest-cache-frequency duration The frequency that the checks for stale records is performed (default 1h0m0s)
--docker-manifest-cache-size uint Specifies the number of items that can be held in the manifest cache (default 1000)
--hybrid-nodes int How many hybrid (requester and compute) nodes should be started in the cluster
--ignore-physical-resource-limits When set the compute node will ignore is physical resource limits
--job-execution-timeout-bypass-client-id strings List of IDs of clients that are allowed to bypass the job execution timeout check
--job-negotiation-timeout duration Timeout value to hold a bid for a job. (default 3m0s)
--job-selection-accept-networked Accept jobs that require network access.
--job-selection-data-locality local|anywhere Only accept jobs that reference data we have locally ("local") or anywhere ("anywhere"). (default Anywhere)
--job-selection-probe-exec string Use the result of a exec an external program to decide if we should take on the job.
--job-selection-probe-http string Use the result of a HTTP POST to decide if we should take on the job.
--job-selection-reject-stateless Reject jobs that don't specify any data.
--limit-job-cpu string Job CPU core limit to run all jobs (e.g. 500m, 2, 8).
--limit-job-gpu string Job GPU limit to run all jobs (e.g. 1, 2, or 8).
--limit-job-memory string Job Memory limit to run all jobs (e.g. 500Mb, 2Gb, 8Gb).
--limit-total-cpu string Total CPU core limit to run all jobs (e.g. 500m, 2, 8).
--limit-total-gpu string Total GPU limit to run all jobs (e.g. 1, 2, or 8).
--limit-total-memory string Total Memory limit to run all jobs (e.g. 500Mb, 2Gb, 8Gb).
--max-job-execution-timeout duration The maximum execution timeout this compute node supports. Jobs with higher timeout requirements will not be bid on. (default 2562047h47m16s)
--memory-profiling-file string File to save memory profiling to
--min-job-execution-timeout duration The minimum execution timeout this compute node supports. Jobs with lower timeout requirements will not be bid on. (default 500ms)
--peer string Connect node 0 to another network node
--pluggable-executors Will use pluggable executors when set to true
--requester-job-translation-enabled Whether jobs should be translated at the requester node or not. Default: false
--requester-nodes int How many requester only nodes should be started in the cluster (default 1)
--self-signed Specifies whether to auto-generate a self-signed certificate for the requester node
--stack-repo string Folder to act as the devstack configuration repo
--tlscert string Specifies a TLS certificate file to be used by the requester node
--tlskey string Specifies a TLS key file matching the certificate to be used by the requester node
Flags:-c,--constraintsstringSelector (label query) to filter nodes on which this job can be executed.Supports'=','==',and'!='.(e.g.-skey1=value1,key2=value2).Matchingobjectsmustsatisfyallofthespecifiedlabelconstraints.--countintHowmanynodesshouldrunthejob. (default 1)--cpustringJobCPUcores (e.g. 500m,2,8).--diskstringJobDiskrequirement (e.g. 500Gb,2Tb,8Tb).--domainstringArrayDomain(s) thatthejobneedstoaccess (for HTTPnetworking)--dry-runDonotsubmitthejob,butinsteadprintoutwhatwillbesubmitted--entrypointstringsOverridethedefaultENTRYPOINToftheimage-e,--envstringsTheenvironmentvariablestosupplytothejob (e.g. --envFOO=bar--envBAR=baz)-f,--followWhenspecifiedwillfollowtheoutputfromthejobasitruns--gpustringJobGPUrequirement (e.g. 1,2,8).--id-onlyPrintoutonlytheJobIDonsuccessfulsubmission.-i,--inputstorageMountURIsasinputstothejob.Canbespecifiedmultipletimes.Format:src=URI,dst=PATH[,opt=key=value]Examples:# Mount IPFS CID to /inputs directory-iipfs://QmeZRGhe4PmjctYVSVHuEiA9oSXnqmYa4kQubSHgWbjv72# Mount S3 object to a specific path-is3://bucket/key,dst=/my/input/path# Mount S3 object with specific endpoint and region-isrc=s3://bucket/key,dst=/my/input/path,opt=endpoint=https://s3.example.com,opt=region=us-east-1--ipfs-connectstringTheipfshostmultiaddresstoconnectto,otherwiseanin-processIPFSnodewillbecreatedifnotset.-l,--labelsstringsListoflabelsforthejob.Entermultipleintheformat'-labels env=prod -label region=earth'.Validlabelkeysmustconsistofalphanumericcharacters,'-','_'or'.',andmuststartandendwithanalphanumericcharacter.Validlabelvaluesmustbeanemptystringorconsistofalphanumericcharacters,'-','_'or'.',andmuststartandendwithanalphanumericcharacter.--memorystringJobMemoryrequirement (e.g. 500Mb,2Gb,8Gb).--namestringThenametorefertothisjobby.--namespacestringThenamespacetoassociatewiththisjob. (default "default")--networknetwork-typeNetworkingcapabilityrequiredbythejob.None,HTTP,orFull (default None)--node-detailsPrintoutdetailsofallnodes (overridden by--id-only).-o,--outputResultPathname=pathoftheoutputdatavolumes.'outputs:/outputs'isalwaysaddedunless'/outputs'ismappedtoadifferentname.--priorityintThepriorityofthejob.-p,--publisherpublisherWheretopublishtheresultofthejob--queue-timeoutintJobqueuetimeoutinseconds (e.g. 300for5minutes). zerotimeoutmeansnoqueueingisenabledandjobswillfailiftheycannotbescheduledimmediately--targetall|anyWhethertotargettheminimumnumberofmatchingnodes ("any") (default) or all matching nodes ("all"). (defaultany)--task-namestringThenametorefertothistaskby (default "main")--timeoutintJobexecutiontimeoutinseconds (e.g. 300for5minutes)--waitWaitforthejobtofinish.Use--wait=falsetoreturnassoonasthejobissubmitted. (default true)--wait-timeout-secsintWhenusing--wait,howmanysecondstowaitforthejobtocompletebeforegivingup. (default 600)-w,--workdirstringWorkingdirectoryinsidethecontainer.Overridestheworkingdirectoryshippedwiththeimage (e.g. viaWORKDIRinDockerfile).
Let's run a Docker job, using the image dpokidov/imagemagick, with a CID mounted at /input_images and an output volume mounted at /outputs in the container. All flags after the -- are passed directly into the container for execution:
This command allows you to start a job in a Docker container using the specified image, mount an external CID resource from IPFS inside the container to handle images, and execute a command inside the container to process files.
To check the job specification before submitting it to the bacalhau network, run:
bacalhaudockerrun--dry-runubuntuechohello
The command does not run the job itself, but only displays information about how it would be run so you can make sure that all job parameters and commands are correctly specified before sending it to the Bacalhau network for execution
To save the job specification to a YAML file, run:
The command starts an Ubuntu image container using a specific version of the image identified by its SHA256 hash. This ensures the accuracy of the image source, independent of its tag and possible future changes, since the image digest remains constant for a particular version.
The bacalhau exec command is used to execute a specific job type.
Usage:
bacalhauexec [jobtype] [flags]
Flags:--codestringSpecifiesthefile,ordirectoryofcodetosendwiththerequest--dry-runDonotsubmitthejob,butinsteadprintoutwhatwillbesubmitted-e,--envstringsTheenvironmentvariablestosupplytothejob (e.g. --envFOO=bar--envBAR=baz)-f,--followWhenspecifiedwillfollowtheoutputfromthejobasitruns-h,--helphelpforexec--id-onlyPrintoutonlytheJobIDonsuccessfulsubmission.-i,--inputstorageMountURIsasinputstothejob.Canbespecifiedmultipletimes.Format:src=URI,dst=PATH[,opt=key=value]Examples:# Mount IPFS CID to /inputs directory-iipfs://QmeZRGhe4PmjctYVSVHuEiA9oSXnqmYa4kQubSHgWbjv72# Mount S3 object to a specific path-is3://bucket/key,dst=/my/input/path# Mount S3 object with specific endpoint and region-isrc=s3://bucket/key,dst=/my/input/path,opt=endpoint=https://s3.example.com,opt=region=us-east-1-l,--labelsstringsListoflabelsforthejob.Entermultipleintheformat'-l a -l 2'.Allcharactersnotmatching/a-zA-Z0-9_:|-/andallemojiswillbestripped.--node-detailsPrintoutdetailsofallnodes (overridden by--id-only).-o,--outputstringsname:pathoftheoutputdatavolumes.'outputs:/outputs'isalwaysaddedunless'/outputs'ismappedtoadifferentname. (default [outputs:/outputs])-p,--publisherpublisherWheretopublishtheresultofthejob (default ipfs)-s,--selectorstringSelector (label query) to filter nodes on which this job can be executed, supports '=', '==', and '!='.(e.g.-skey1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.--timeoutintJobexecutiontimeoutinseconds (e.g. 300for5minutes)--waitWaitforthejobtofinish.Use--wait=falsetoreturnassoonasthejobissubmitted. (default true)--wait-timeout-secsintWhenusing--wait,howmanysecondstowaitforthejobtocompletebeforegivingup. (default 600)
The bacalhau agent node command shows bacalhau node id info.
Usage:
bacalhauagentnode [flags]
Flags:-h,--helphelpforid--hide-headerdonotprintthecolumnheaders.--no-styleremoveallstylingfromtableoutput.--outputformatTheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaultjson)--peerstringAcomma-separatedlistoflibp2pmultiaddresstoconnectto.Use"none"toavoidconnectingtoanypeer,"env"toconnecttothedefaultpeerlistofyouractiveenvironment (see BACALHAU_ENVIRONMENTenvvar). (default"none")--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--swarm-portintTheporttolistenonforswarmconnections. (default 1235)--widePrintfullvaluesinthetableresults
The bacalhau job command provides a suite of sub-commands to submit, query, and manage jobs within Bacalhau. Users can deploy jobs, obtain job details, track execution logs, and more.
The bacalhau job describe command provides a detailed description of a specific job in YAML format. This description can be particularly useful when wanting to understand the attributes and current status of a specific job. To list all available jobs, the bacalhau job list command can be used.
Flags:-h,--helphelpfordescribe--outputformatTheoutputformatforthecommand (one of ["json""yaml"]) (defaultyaml)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.
The bacalhau job get command is used to get the results of the job, including stdout and stderr.
Usage:
bacalhaujobget [id] [flags]
Flags:--download-timeout-secsdurationTimeoutdurationforIPFSdownloads. (default 5m0s)-h,--helphelpforget--ipfs-connectstringTheipfshostmultiaddresstoconnectto,otherwiseanin-processIPFSnodewillbecreatedifnotset.--ipfs-serve-pathstringpathlocalIpfsnodewillpersistdatato --ipfs-swarm-addrs strings IPFS multiaddress to connect the in-process IPFS node to - cannot be used with --ipfs-connect. (default [/ip4/35.245.161.250/tcp/4001/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/35.245.161.250/udp/4001/quic/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/34.86.254.26/tcp/4001/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/34.86.254.26/udp/4001/quic/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/35.245.215.155/tcp/4001/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/35.245.215.155/udp/4001/quic/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/34.145.201.224/tcp/4001/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/34.145.201.224/udp/4001/quic/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/35.245.41.51/tcp/4001/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa,/ip4/35.245.41.51/udp/4001/quic/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa])
--ipfs-swarm-keystringOptionalIPFSswarmkeyrequiredtoconnecttoaprivateIPFSswarm--output-dirstringDirectorytowritetheoutputto.--private-internal-ipfsWhetherthein-processIPFSnodeshouldauto-discoverothernodes,includingthepublicIPFSnetwork-cannotbeusedwith--ipfs-connect.Use"--private-internal-ipfs=false"todisable.TopersistalocalIpfsnode,setBACALHAU_SERVE_IPFS_PATHtoavalidpath. (default true)--rawDownloadrawresultCIDsinsteadofmergingmultipleCIDsintoasingleresult
The bacalhau job executions command retrieves a list of executions for a specific job based on its ID. This can be essential when tracking the various runs and their respective states for a particular job.
Flags:-h,--helphelpforexecutions--hide-headerdonotprintthecolumnheaderswhendisplayingtheresults.--limituint32Limitthenumberofresultsreturned (default 20)--next-tokenstringUsesthespecifiedtokenforpagination.Usefulforfetchingthenextsetofresults.--no-styleremoveallstylingfromtableoutputdisplayingrawdata.--order-bystringOrderresultsbasedonaspecificfield.Validfieldsare:modify_time,create_time,id,state--order-reversedReversetheorderoftheresults.Usefulinconjunctionwith--order-by.--outputformatSpecifytheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaulttable)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--widePrintfullvaluesinthetableresultwithouttruncatinganyinformation.
The bacalhau job history command lists the history events of a specific job based on its ID. This feature allows users to track changes, executions, and other significant milestones associated with a particular job.
Flags:--event-typestringThetypeofhistoryeventstoreturn.Oneof:all,job,execution (default "all")--execution-idstringFiltersresultsbyaspecificexecutionID.-h,--helphelpforhistory--hide-headerdonotprintthecolumnheaders.--limituint32Limitthenumberofresultsreturned--next-tokenstringUsesthespecifiedtokenforpagination.--no-styleremoveallstylingfromtableoutput.--node-idstringFilterstheresultsbyaspecificnodeID.--order-bystringOrderresultsbyafield--order-reversedReversetheorderoftheresults--outputformatTheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaulttable)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--widePrintfullvaluesinthetableresultswithouttruncatinganyinformation.
The bacalhau job list command provides a listing of all submitted jobs. This command offers an overview of all tasks and processes registered in the system, allowing users to monitor and manage their jobs effectively.
The bacalhau job logs command allows users to retrieve logs from a job that has been previously submitted. This command is useful for tracking and debugging the progress and state of a running or completed job.
To display Logs for a Previously Submitted Job using Full Job ID, run:
bacalhaujoblogsj-51225160-807e-48b8-88c9-28311c7899e1ExpectedOutput:[2023-09-24 09:01:32] INFO - Application started successfully.[2023-09-24 09:01:33] DEBUG - Initializing database connections.[2023-09-24 09:01:35] WARN - API rate limit approaching.[2023-09-24 09:02:01] ERROR - Failed to retrieve data from endpoint: /api/v1/data.[2023-09-24 09:05:00] INFO - Data sync completed with 4500 new records.
To follow Logs in Real-Time, run:
bacalhaujoblogs--followj-51225160-807e-48b8-88c9-28311c7899e1ExpectedOutput:[2023-09-24 11:30:02] INFO - User 'john_doe' logged in successfully.[2023-09-24 11:30:15] DEBUG - Fetching data from cache for key: userSettings_john_doe.[2023-09-24 11:31:05] WARN - High memory usage detected: 85% of allocated resources.... [Logs continuetoappearinreal-time]...
The bacalhau job run command facilitates the initiation of a job from a file or directly from the standard input (stdin). The command supports both JSON and YAML data formats. This command is particularly useful for quickly executing a job without the need for manual configurations.
Flags:--dry-runDonotsubmitthejob,butinsteadprintoutwhatwillbesubmitted-f,--followWhenspecifiedwillcontinuouslydisplaytheoutputfromthejobasitruns-h,--helphelpforrun--id-onlyPrintoutonlytheJobIDonsuccessfulsubmission.--no-templateDisablethetemplatingfeature.Whenthisflagisset,thejobspecwillbeusedas-is,withoutanyplaceholderreplacements--node-detailsPrintoutdetailsofallnodes (Note thatthisflagisoverriddenif--id-onlyisprovided).--show-warningsShowsanywarningsthatoccurduringthejobsubmission-E,--template-envsstringSpecifyaregularexpressionpatternforselectingenvironmentvariablestobeincludedastemplatevariablesinthejobspec.e.g.--template-envs".*"willincludeallenvironmentvariables.-V,--template-varsstringToStringReplaceaplaceholderinthejobspecwithavalue.e.g.--template-varsfoo=bar--waitWaitforthejobtofinish.Use--wait=falsetoreturnassoonasthejobissubmitted. (default true)--wait-timeout-secsintIf--waitisprovided,thisflagsetsthemaximumtime (in seconds) the command will wait for the job to finish before it terminates. (default600)
The bacalhau job stop command allows users to terminate a previously submitted job. This is useful in scenarios where there's a need to halt a running job, perhaps due to misconfiguration or changed priorities.
The bacalhau job logs command retrieves the log output (stdout, and stderr) from a job. If the job is still running it is possible to follow the logs after the previously generated logs are retrieved.
The bacalhau job validate command allows you to validate job files in JSON or YAML formats before sending them to the Bacalhau system. It is used to confirm that the structure and contents of the job description file conform to the expected format.
The bacalhau job list command lists jobs on the network.
Usage:
bacalhaujoblist [flags]
Flags:--allFetchalljobsfromthenetwork (default istofilterthosebelongingtotheuser). This option may take a long time to return, please use with caution.--exclude-tagstringsOnlyreturnjobsthatdonothavethepassedtagintheirannotations (default [canary])-h,--helphelpforlist--hide-headerdonotprintthecolumnheaders.--id-filterstringfilterbyJobListtoIDsmatchingsubstring.--include-tagstringsOnlyreturnjobsthathavethepassedtagintheirannotations--no-styleremoveallstylingfromtableoutput.-n,--numberintprintthefirstNUMjobsinsteadofthefirst10. (default 10)--outputformatTheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaulttable)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--reversereverseorderoftable-fortimesorting,thiswillbenewestfirst.Use'--reverse=false'tosortoldestfirst (single quotesarerequired). (defaulttrue)--sort-byColumnsortbyfield,defaultstocreationtime,withnewestfirst [Allowed "id","created_at"]. (default created_at)--widePrintfullvaluesinthetableresults
The bacalhau node command provides a set of sub-commands to query and manage node-related information within Bacalhau. With these tools, users can access specific details about nodes, list all network nodes, and more.
The bacalhau node describe command offers users the ability to retrieve detailed information about a specific node using its unique identifier. This information is crucial for system administrators and network managers to understand the state, specifications, and other attributes of nodes in their infrastructure.
Flags:-h,--helphelpfordescribe--outputformatTheoutputformatforthecommand (one of ["json""yaml"]) (defaultyaml)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.
The bacalhau node list command is designed to provide users with a comprehensive list of network nodes along with details based on specified flags. It supports various filtering, ordering, and output formatting options, allowing users to tailor the output to their needs.
Flags:-h,--helphelpforlist--hide-headerdonotprintthecolumnheaders.--labelsstringFilternodesbylabels.Seehttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels/formoreinformation.--limituint32Limitthenumberofresultsreturned--next-tokenstringNexttokentouseforpagination--no-styleremoveallstylingfromtableoutput.--order-bystringOrderresultsbyafield.Validfieldsare:id,type,available_cpu,available_memory,available_disk,available_gpu--order-reversedReversetheorderoftheresults--outputformatTheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaulttable)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--showstringsWhatcolumngroupstoshow.Zeroormoreof: ["features""capacity""labels""version"] (default [labels,capacity])--widePrintfullvaluesinthetableresultswithouttruncation.
The bacalhau serve command starts a bacalhau node.
Usage:
bacalhauserve [flags]
Flags:--allow-listed-local-pathsstringsLocalpathsthatareallowedtobemountedintojobs--autocertstringSpecifiesahostnameforwhichACMEisusedtoobtainaTLSCertificate.UsingthisoptionresultsintheAPIservingoverHTTPS--compute-execution-store-pathstringThepathusedforthecomputeexecutionstorewhenusingBoltDB--compute-execution-store-typestorage-typeThetypeofstoreusedbythecomputenode (BoltDB orInMemory) (defaultBoltDB)--default-job-execution-timeoutdurationdefaultvaluefortheexecutiontimeoutthiscomputenodewillassigntojobswithnotimeoutrequirementdefined. (default 10m0s)--disable-enginestringsEnginetypestodisable--disable-storagestringsStoragetypestodisable--disabled-publisherstringsPublishertypestodisable-h,--helphelpforserve--hoststringThehosttoserveon. (default "0.0.0.0")--ignore-physical-resource-limitsWhensetthecomputenodewillignoreisphysicalresourcelimits--ipfs-connectstringTheipfshostmultiaddresstoconnectto,otherwiseanin-processIPFSnodewillbecreatedifnotset.--ipfs-serve-pathstringpathlocalIpfsnodewillpersistdatato --ipfs-swarm-addrs strings IPFS multiaddress to connect the in-process IPFS node to - cannot be used with --ipfs-connect. (default [/ip4/35.245.161.250/tcp/4001/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/35.245.161.250/udp/4001/quic/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/34.86.254.26/tcp/4001/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/34.86.254.26/udp/4001/quic/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/35.245.215.155/tcp/4001/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/35.245.215.155/udp/4001/quic/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/34.145.201.224/tcp/4001/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/34.145.201.224/udp/4001/quic/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/35.245.41.51/tcp/4001/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa,/ip4/35.245.41.51/udp/4001/quic/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa])
--ipfs-swarm-keystringOptionalIPFSswarmkeyrequiredtoconnecttoaprivateIPFSswarm--job-execution-timeout-bypass-client-idstringsListofIDsofclientsthatareallowedtobypassthejobexecutiontimeoutcheck--job-negotiation-timeoutdurationTimeoutvaluetoholdabidforajob. (default 3m0s)--job-selection-accept-networkedAcceptjobsthatrequirenetworkaccess.--job-selection-data-localitylocal|anywhereOnlyacceptjobsthatreferencedatawehavelocally ("local") or anywhere ("anywhere"). (defaultAnywhere)--job-selection-probe-execstringUsetheresultofaexecanexternalprogramtodecideifweshouldtakeonthejob.--job-selection-probe-httpstringUsetheresultofaHTTPPOSTtodecideifweshouldtakeonthejob.--job-selection-reject-statelessRejectjobsthatdon't specify any data. --labels stringToString Labels to be associated with the node that can be used for node selection and filtering. (e.g. --labels key1=value1,key2=value2) (default []) --limit-job-cpu string Job CPU core limit to run all jobs (e.g. 500m, 2, 8). --limit-job-gpu string Job GPU limit to run all jobs (e.g. 1, 2, or 8). --limit-job-memory string Job Memory limit to run all jobs (e.g. 500Mb, 2Gb, 8Gb). --limit-total-cpu string Total CPU core limit to run all jobs (e.g. 500m, 2, 8). --limit-total-gpu string Total GPU limit to run all jobs (e.g. 1, 2, or 8). --limit-total-memory string Total Memory limit to run all jobs (e.g. 500Mb, 2Gb, 8Gb). --max-job-execution-timeout duration The maximum execution timeout this compute node supports. Jobs with higher timeout requirements will not be bid on. (default 2562047h47m16s) --min-job-execution-timeout duration The minimum execution timeout this compute node supports. Jobs with lower timeout requirements will not be bid on. (default 500ms) --node-type strings Whether the node is a compute, requester or both. (default [requester]) --peer string A comma-separated list of libp2p multiaddress to connect to. Use "none" to avoid connecting to any peer, "env" to connect to the default peer list of your active environment (see BACALHAU_ENVIRONMENT env var). (default "none") --port int The port to server on. (default 1234) --private-internal-ipfs Whether the in-process IPFS node should auto-discover other nodes, including the public IPFS network - cannot be used with --ipfs-connect. Use "--private-internal-ipfs=false" to disable. To persist a local Ipfs node, set BACALHAU_SERVE_IPFS_PATH to a valid path. (default true) --requester-job-store-path string The path used for the requester job store store when using BoltDB --requester-job-store-type storage-type The type of job store used by the requester node (BoltDB or InMemory) (default BoltDB) --swarm-port int The port to listen on for swarm connections. (default 1235) --tlscert string Specifies a TLS certificate file to be used by the requester node --tlskey string Specifies a TLS key file matching the certificate to be used by the requester node --web-ui Whether to start the web UI alongside the bacalhau node.
The bacalhau version command allows you to get the client and server version.
Usage:
bacalhauversion [flags]
Flags:--clientIftrue,showsclientversiononly (no serverrequired).-h,--helphelpforversion--hide-headerdonotprintthecolumnheaders.--no-styleremoveallstylingfromtableoutput.--outputformatTheoutputformatforthecommand (one of ["table""csv""json""yaml"]) (defaulttable)--prettyPrettyprinttheoutput.Onlyappliestojsonandyamloutputformats.--widePrintfullvaluesinthetableresults
The bacalhau wasm run command Runs a job that was compiled to WASM.
Flags:--concurrencyintHowmanynodesshouldrunthejob (default 1)--cpustringJobCPUcores (e.g. 500m,2,8).--diskstringJobDiskrequirement (e.g. 500Gb,2Tb,8Tb).--domainstringArrayDomain(s) thatthejobneedstoaccess (for HTTPnetworking)--downloadShouldwedownloadtheresultsoncethejobiscomplete?--download-timeout-secsdurationTimeoutdurationforIPFSdownloads. (default 5m0s)--dry-runDonotsubmitthejob,butinsteadprintoutwhatwillbesubmitted--entry-pointstringThenameoftheWASMfunctionintheentrymoduletocall.Thisshouldbeazero-parameterzero-resultfunctionthatwillexecutethejob. (default "_start")-e,--envstringsTheenvironmentvariablestosupplytothejob (e.g. --envFOO=bar--envBAR=baz)-f,--followWhenspecifiedwillfollowtheoutputfromthejobasitruns-g,--gettimeoutintTimeoutforgettingtheresultsofajobin--wait (default 10)--gpustringJobGPUrequirement (e.g. 1,2,8).-h,--helphelpforrun--id-onlyPrintoutonlytheJobIDonsuccessfulsubmission.-U,--import-module-urlsurlURLoftheWASMmodulestoimportfromaURLsource.URLacceptanyvalidURLsupportedbythe'wget'command,andsupportsbothHTTPandHTTPS.-I,--import-module-volumescid:pathCID:pathoftheWASMmodulestoimportfromIPFS,ifyouneedtosetthepathofthemounteddata.-i,--inputstorageMountURIsasinputstothejob.Canbespecifiedmultipletimes.Format:src=URI,dst=PATH[,opt=key=value]Examples:# Mount IPFS CID to /inputs directory-iipfs://QmeZRGhe4PmjctYVSVHuEiA9oSXnqmYa4kQubSHgWbjv72# Mount S3 object to a specific path-is3://bucket/key,dst=/my/input/path# Mount S3 object with specific endpoint and region-isrc=s3://bucket/key,dst=/my/input/path,opt=endpoint=https://s3.example.com,opt=region=us-east-1--ipfs-connectstringTheipfshostmultiaddresstoconnectto,otherwiseanin-processIPFSnodewillbecreatedifnotset.--ipfs-serve-pathstringpathlocalIpfsnodewillpersistdatato --ipfs-swarm-addrs strings IPFS multiaddress to connect the in-process IPFS node to - cannot be used with --ipfs-connect. (default [/ip4/35.245.161.250/tcp/4001/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/35.245.161.250/udp/4001/quic/p2p/12D3KooWAQpZzf3qiNxpwizXeArGjft98ZBoMNgVNNpoWtKAvtYH,/ip4/34.86.254.26/tcp/4001/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/34.86.254.26/udp/4001/quic/p2p/12D3KooWLfFBjDo8dFe1Q4kSm8inKjPeHzmLBkQ1QAjTHocAUazK,/ip4/35.245.215.155/tcp/4001/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/35.245.215.155/udp/4001/quic/p2p/12D3KooWH3rxmhLUrpzg81KAwUuXXuqeGt4qyWRniunb5ipjemFF,/ip4/34.145.201.224/tcp/4001/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/34.145.201.224/udp/4001/quic/p2p/12D3KooWBCBZnXnNbjxqqxu2oygPdLGseEbfMbFhrkDTRjUNnZYf,/ip4/35.245.41.51/tcp/4001/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa,/ip4/35.245.41.51/udp/4001/quic/p2p/12D3KooWJM8j97yoDTb7B9xV1WpBXakT4Zof3aMgFuSQQH56rCXa])
--ipfs-swarm-keystringOptionalIPFSswarmkeyrequiredtoconnecttoaprivateIPFSswarm-l,--labelsstringsListoflabelsforthejob.Entermultipleintheformat'-l a -l 2'.Allcharactersnotmatching/a-zA-Z0-9_:|-/andallemojiswillbestripped.--memorystringJobMemoryrequirement (e.g. 500Mb,2Gb,8Gb).--networknetwork-typeNetworkingcapabilityrequiredbythejob.None,HTTP,orFull (default None)--node-detailsPrintoutdetailsofallnodes (overridden by--id-only).-o,--outputstringsname:pathoftheoutputdatavolumes.'outputs:/outputs'isalwaysaddedunless'/outputs'ismappedtoadifferentname. (default [outputs:/outputs])--output-dirstringDirectorytowritetheoutputto.--private-internal-ipfsWhetherthein-processIPFSnodeshouldauto-discoverothernodes,includingthepublicIPFSnetwork-cannotbeusedwith--ipfs-connect.Use"--private-internal-ipfs=false"todisable.TopersistalocalIpfsnode,setBACALHAU_SERVE_IPFS_PATHtoavalidpath. (default true)-p,--publisherpublisherWheretopublishtheresultofthejob (default ipfs)--rawDownloadrawresultCIDsinsteadofmergingmultipleCIDsintoasingleresult-s,--selectorstringSelector (label query) to filter nodes on which this job can be executed, supports '=', '==', and '!='.(e.g.-skey1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.--targetall|anyWhethertotargettheminimumnumberofmatchingnodes ("any") (default) or all matching nodes ("all") (defaultany)--timeoutintJobexecutiontimeoutinseconds (e.g. 300for5minutes)--waitWaitforthejobtofinish.Use--wait=falsetoreturnassoonasthejobissubmitted. (default true)--wait-timeout-secsintWhenusing--wait,howmanysecondstowaitforthejobtocompletebeforegivingup. (default 600)