Ensure you have bacalhau installed
curl -sL https://get.bacalhau.org/install.sh | bash
Check if it is already installed using:
bacalhau version
> Client Version: v0.x.y
> Server Version: v0.x.y
Docker Image: mihirsinhparmar/ie-bac
Run job on bacalhau without inputs
bacalhau docker run mihirsinhparmar/bacalhau-ie
Run job with inputs using HTTPs
bacalhau docker run --input-urls https://nftstorage.link/ipfs/bafybeiblg4ymbxuhpckcsfkdhn52o4l4iakc6wgjptp4fil4ctjcvdsvp4 mihirsinhparmar/bacalhau-ie
A shell script is crated to help with easy build and push of Docker Images To build docker image using following command:
yarn build
This will prompt to select the type of CPU you use, Either select A or B.
Once selected, follow the prompts and script will handle the following:
- Install Dependencies if packages are not installed.
- Compile TypeScript Files.
- Build Docker Image
- Run Docker Image locally
- Push Docker Image
The code is written in typescript and it needs to be compile and converted first. To compile, use following command
yarn compile
The compiled files will be stored in ./scripts
.
Bacalhau requires the Docker image to be x86 (amd64) architecture.
Build docker image using this command
docker build -t NAME .
docker run NAME
Add a tag to docker image Push the docker container
If you are on Apple Silicon machine use this script to build Docker Image
docker buildx build --platform linux/amd64 --push -t USERNAME/NAME .
where USERNAME is your docker hub username and, NAME is the name of docker image
Bacalhau might cache the docker image and hence it might take some time for bacalhau to pick up latest docker image. Sometimes if you run newly deployed docker image, bacalhau might still run an old version of docker image.
New files pinned to IPFS are not directly added to Filecoin. It takes some time for those files to be added to filecoin. Meanwhile the filecoin deals are been made, you can use HTTPs urls as input files. to do that use following command:
bacalhau docker run --input-urls $URL $DOCKER_IMAGE
export CID=PLAIN_IPFS_CID
bacalhau docker run -v $CID:/inputs USERNAME/NAME