Astro
Running Impulse
Astro
The easiest way to run impulse is through a bash script that allows for bringing up the necessary parts of Impulse. You can choose to bring up any available connector and repo.
The script makes use of the docker-tools/compose-template/config/astro.conf
file for configuring the various docker images of Impulse. Use the ./docker-tools/compose-template/config/astro.conf file to control debug options and images for each service and repo.
If you want to run a service in debug
mode, simply build the image of that service, giving it the appropriate name with the tag debug
. i.e. sync-manager:debug The script assumes that all motiv labs github repos live in the same directory and will path a volume relatively to the appropriate service. i.e. /motiv-labs/impulse and /motiv-labs/sync-manager
The script assumes the user is running it from the root of Impulse. It makes use of relative pathing from the root of the Impulse project.
Commands
start
example:
This command will start the list of repos with the given name prepended to their docker containers. It will also start impulse and any required connectors if they are not already running.
Names for each repo should be unique and attempt to avoid including the full name given to another running repo.
i.e. dcms-source
and dcms-source-1
should be avoided. While dcms-source-1
and dcms-source-2
is good.
Pass in as many repos with unique names as you wish to start at a single time.
Flags
--jaeger
The --jaeger
flag will start astro with a jaeger container for tracing. The default is for no jaeger to start.
--fleuntd
The --fluentd
flag will start astro and set all containers to use fluentd logging driver. The default is for no fluentd to start.
--no-db
The --no-db
flag will start astro without a local DB container. The default is to start the local DB with astro.
reset
example:
This command will reset the passed in list of repos to their default state.
This allows for an easier way to retest a sync job. You can reset a destination repo back to its default state and sync again.
setJanus
This command will create a Janus user "user:pass" and add API proxies to janus. (This command assumes janus admin api is reachable at localhost:8081)
clean
example:
This command will clean (truncate) tables in cassandra based on the input arguments. The input arguments select what group of tables to be cleaned allowing for a fresh run of Impulse.
This allows for easier retest of a sync job where motation does not exist. You can clean the motation tables and sync again.
down
This command will run docker-compose down
all docker containers and remove generated volumes. note: will ask for sudo access to remove volumes
build
This command will build the service/connector/motator as the type selected.
Build types are:
prod
Build a local image like production.
dev
Build a local image that will compile local code.
debug
Build a local image that will compile local code and allow remote debugger connectivity.
build help
List the help for the build command.
list repo
This command will list all the repo options that can be passed in.
list ports
This command will list all the containers ports currently running.
list clean
This command will list all clean options that can be passed in.
list build
This command will list all services that can be built as well as all the types that each service can be built as.
logs
This command will follow the logs of all currently running docker containers generated by this script.
help
This command will give quick help information on the program. help
can be passed in after any command for help information on that specific command.
Finding a Repository's URL
Local Machine URL
Astro starts up and runs at the localhost domain. Meaning you will need to find the repository's port. You can use Astro's list ports
command to find the port of each container running. You can pipe the output to grep and find the specific container you are looking for.
Example:
So, if you want to open the source dotCMS repository in your local browser, you can reach it at localhost:9001
.
Impulse Relative URL
Astro uses docker containers to run all of Impulse and the various repositories. This means that the relative URL for a repository is different for Impulse endpoints config when compared to your local machine. To find the proper relative URL, you need to know a few things.
The correct protocol to use. For instance, to reach dotCMS backend you can use
http
however to reach the postgres database you must usepostgres
The container port. Note: that this is not the same port used for your local machine. Meaning, the Strapi container's backend port is
1337
while the dotCMS container's backend port8080
With the knowledge of which protocol and port are meaningful to the repository, you can again use Astro's list ports
command to find the name of each container running. You can pipe the output to grep and find the specific container you are looking for.
Example:
So, the relative URL for the source dotCMS would be a combination of the correct protocol, container name, and container port. For instance the destination dotCMS database connection path would be postgres://dest-dotcms-db:5432/dotcms
.
Debugging
To debug a service you must locally build that service and give it debug
in the tag. i.e. sync-manager:debug
You then have the option to put the service into dev
or debug
mode by setting, in the conf file, the ${SERVICE_DEBUG} variable to either 0 or 1 respectively.
dev (0)
mode means that the service has a mapped volume and will rebuild code if you restart the container.
debug (1)
mode means that in addition to dev
mode, you can connect a remote debugger to the open debug port and step through the code with your ide.
Troubleshooting Astro
Astro uses GNU sed. If running on OSX, you may have to install GNU sed and set it as default. https://gist.github.com/icasimpan/b93297c17c3e81e33021e8f188b079df
If ports are not being released and a new repo is unable to start run 'service docker restart
Last updated