Skip to content

Commit

Permalink
Update user experience, pipeline, and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeRadinovich committed May 13, 2019
1 parent a502346 commit 034ea64
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 46 deletions.
25 changes: 24 additions & 1 deletion README.md
@@ -1,5 +1,28 @@
# ioFog Demo

This repository orchestrates ioFog Agent, Controller, and Connector in a Docker Compose environment for the purpose of demonstrating a deployment of the ioFog stack.

# Usage

To spin up Agent, Controller, and Connector containers within a virtual network:
```
./start.sh
```

To verify the services are provisioned correctly:
```
./test.sh
```

To interact with Agent, Controller, and Connector you must exec into each respective container and use the CLI:
```
docker exec -it iofog-controller /bin/bash
iofog-controller help
```

Note that if you would like to use Agent, Controller, and Connector's REST APIs, you will have to modify the Compose environment to deploy with network_mode "host".

When you are finished, it is recommended that you teardown:
```
./run.sh
./stop.sh
```
19 changes: 17 additions & 2 deletions azure-pipelines.yml
Expand Up @@ -12,6 +12,21 @@ steps:

- script: |
echo $(gcp.svcacc) | docker login -u _json_key --password-stdin https://gcr.io
displayName: 'Docker connect to Registry'

- script: |
sed -i "s|image:.*|image: $(images.runner)|" docker-compose-test.yml
./run.sh
displayName: 'Run Tests'
cat docker-compose-test.yml
displayName: 'Configure Test Runner image'

- script: |
./start.sh
displayName: 'Start Connector, Controller, and Agent'

- script: |
./test.sh
displayName: 'Run Tests'

- script: |
./stop.sh
displayName: 'Stop Connector, Controller, and Agent'
30 changes: 14 additions & 16 deletions docker-compose-test.yml
@@ -1,18 +1,16 @@
#
# Includes a Test Runner image that is launched and will execute a suite of smoke tests against the ioFog cluster.
#
# NOTE: On it's own this config does nothing, it should be launched at the same time the main docker-compose.yml config.
#
version: "3"
services:

# Test Runner, runs our test suite
test-runner:
image: iofog/test-runner-develop:latest
container_name: test-runner
environment:
- LOCAL=1
volumes:
- ./conf:/conf
test-runner:
container_name: test-runner
environment:
- LOCAL=1
external_links:
- iofog-controller
- iofog-connector
- iofog-agent
image: iofog/test-runner-develop:latest
network_mode: bridge
volumes:
- ./conf:/conf
version: '3'
volumes:
conf:
conf: null
18 changes: 8 additions & 10 deletions docker-compose.yml
@@ -1,19 +1,12 @@
#
# Launches a demo three node cluster that includes a node for Controller, Connector and Agent.
#
# Post launch, we run a set of startup.sh scripts to connect and configure all three services to
# work as a provisioned one node ECN.
#
version: "3"
services:

# ioFog Connector
iofog-connector:
build: ./iofog-connector
container_name: iofog-connector
ports:
- "53321:8080"

network_mode: "bridge"
# ioFog Controller, depends on Connector
iofog-controller:
build: ./iofog-controller
Expand All @@ -24,7 +17,9 @@ services:
- "51121:51121"
environment:
- NODE_ENV=development

network_mode: "bridge"
external_links:
- iofog-connector
# ioFog Agent, depends on Connector and Controller
iofog-agent:
build: ./iofog-agent
Expand All @@ -36,4 +31,7 @@ services:
- "8081:22"
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/docker.sock:/var/run/docker.sock
network_mode: "bridge"
external_links:
- iofog-controller
9 changes: 9 additions & 0 deletions start.sh
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

set -e

rm conf/id_ecdsa* || true
ssh-keygen -t ecdsa -N "" -f conf/id_ecdsa -q
cp conf/id_ecdsa.pub iofog-agent

docker-compose -f docker-compose.yml up --build --detach
5 changes: 5 additions & 0 deletions stop.sh
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

set -e

docker-compose down -v
21 changes: 4 additions & 17 deletions run.sh → test.sh
@@ -1,29 +1,16 @@
#
# Launch script to run our Smoke Test Suite
#
#!/usr/bin/env sh

set -e

# Output the config for our Test suite config
echo 'iofog-connector:8080' > conf/connector.conf
echo 'iofog-controller:51121' > conf/controller.conf
echo 'root@iofog-agent' > conf/agents.conf

rm conf/id_ecdsa*

ssh-keygen -t ecdsa -N "" -f conf/id_ecdsa -q

cp conf/id_ecdsa.pub iofog-agent

docker-compose -f docker-compose-test.yml pull test-runner
docker-compose -f docker-compose.yml -f docker-compose-test.yml up \
docker-compose -f docker-compose-test.yml up \
--build \
--abort-on-container-exit \
--exit-code-from test-runner \
--force-recreate \
--renew-anon-volumes

ERR="$?"

docker-compose down -v

exit "$ERR"
--renew-anon-volumes

0 comments on commit 034ea64

Please sign in to comment.