Installation with OS X and Docker
This is a short instruction on how to install Anduril on OS X using Docker and how to test file sharing between OS X and Docker container and how to test the Anduril installation.
Install Docker Desktop
- Create yourself a Docker user account in Docker Hub.
- Download Docker Desktop for Mac.
- Follow the instructions from Docker documentation to install Docker Desktop.
- Sing in to Docker Desktop using your username and password.
Configure Docker Desktop
If you want to use port forwarding using local IP such as 127.0.0.1, set the host ip for port forwarding in Docker’s Preferences > Daemon > Advanced by adding line “ip” : “<ip for port forwarding>” to the configuration file, for example:
{
"debug" : true,
"ip" : "127.0.0.1",
"experimental" : true
}
Start the Anduril container
Container can be started with command
docker run -p 8000:8000 -td -v $(pwd)/shared:/opt/shared anduril/core bash
- -p parameter sets port forwarding from host to container using ports 8000 and the IP configured above.
- -v parameter connects host computer’s folder ~/shared to the Anduril container’s /opt/shared folder.
This should start downloading Anduril container if it is not installed and show the following messages:
Unable to find image 'anduril/core:latest' locally
latest: Pulling from anduril/core
6cf436f81810: Downloading [=========>
...
The name and ID of the running container can be obtained with command
docker container ls
You should obtain a list with following headers:
CONTAINER ID IMAGE ... PORTS NAMES
3bd695dbc87d anduril/core ... 127.0.0.1:8000->8000/tcp kind_yonath
Connect to a running Anduril container
Now you can connect from terminal to Anduril container with the container name (or id):
docker exec -it kind_yonath /bin/bash
You should be connected to the container and see a command prompt such as:
root@7a7652bd7e82:/anduril#
Test the file sharing:
In your local machine, create a file, for example workflow.scala in ~/shared folder with the following contents:
#!/usr/bin/env anduril
import anduril.builtin._
import anduril.tools._
import org.anduril.runtime._
object HelloWorld {
info("Beginning workflow construction")
val helloWorld = BashEvaluate(script = "echo Hello world!")
info("Ending workflow construction")
}
In Anduril container, check if the file exists:
cd /opt/shared
ls
Test the Anduril:
Run the following command in /opt/shared in Anduril container:
anduril run workflow.scala
This should yeald result as described in Getting started: workflows. The same result can be obtained when the file is made executable:
chmod +x workflow.scala
and run with command.
./workflow.scala