Skip to content

Commit

Permalink
Merge branch 'release/1.3.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lkrcal committed Nov 7, 2019
2 parents ddc58e6 + e4a70be commit 8188a48
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 40 deletions.
8 changes: 1 addition & 7 deletions azure-pipelines.yml
Expand Up @@ -35,14 +35,8 @@ steps:
echo $(gcp.svcacc) | docker login -u _json_key --password-stdin https://gcr.io
displayName: 'Docker connect to Registry'

# - script: |
# docker pull gcr.io/focal-freedom-236620/controller:develop
# docker pull gcr.io/focal-freedom-236620/connector:develop
# docker pull gcr.io/focal-freedom-236620/agent:develop
# displayName: 'Pull latest images'

- script: |
./start.sh tutorial || iofogctl version
./start.sh tutorial
# Use dev version of agent and controller until 1.3.0 release
# ./start.sh -ct gcr.io/focal-freedom-236620/controller:develop -a gcr.io/focal-freedom-236620/agent:develop -cn gcr.io/focal-freedom-236620/connector:develop
displayName: 'Start Connector, Controller, Agent, and tutorial microservices'
Expand Down
8 changes: 4 additions & 4 deletions start.sh
Expand Up @@ -31,7 +31,7 @@ printHelp() {
startIofog() {
# If stack is running, skip
local CONTROLLER_CONTAINER_ID=$(docker ps -q --filter="name=iofog-controller")
if ! [[ -z $CONTROLLER_CONTAINER_ID ]]; then
if ! [[ -z "${CONTROLLER_CONTAINER_ID}" ]]; then
return
fi

Expand Down Expand Up @@ -95,9 +95,9 @@ startEnvironment() {

ENVIRONMENT=''
IOFOG_BUILD_NO_CACHE=''
AGENT_IMAGE='docker.io/iofog/agent:1.3.0-beta'
CONTROLLER_IMAGE='docker.io/iofog/controller:1.3.0-beta'
CONNECTOR_IMAGE='docker.io/iofog/connector:1.3.0-beta'
AGENT_IMAGE='docker.io/iofog/agent:1.3.0-rc1'
CONTROLLER_IMAGE='docker.io/iofog/controller:1.3.0-rc3'
CONNECTOR_IMAGE='docker.io/iofog/connector:1.3.0-rc1'
while [[ "$#" -ge 1 ]]; do
case "$1" in
-h|--help)
Expand Down
58 changes: 29 additions & 29 deletions test.sh
Expand Up @@ -47,38 +47,38 @@ AGENT_CONTAINER_ID=$(docker ps -q --filter="name=iofog-agent")
# Configuring ssh on the agent
echoInfo "Configuring ssh on the Agent"
# Init log file
configureSSHLogFile=/tmp/configure_ssh.log
if [ -f $configureSSHLogFile ]; then
rm $configureSSHLogFile
CONFIGURE_SSH_LOG_FILE=/tmp/configure_ssh.log
if [[ -f "${CONFIGURE_SSH_LOG_FILE}" ]]; then
rm "${CONFIGURE_SSH_LOG_FILE}"
fi
echo '' > $configureSSHLogFile
echo '' > "${CONFIGURE_SSH_LOG_FILE}"
{
echo 'Removing /var/lib/apt/lists/lock' >> $configureSSHLogFile
docker exec iofog-agent sudo rm /var/lib/apt/lists/lock >> $configureSSHLogFile 2>&1
echo 'Updating apt-get' >> $configureSSHLogFile
docker exec iofog-agent apt-get update -y >> $configureSSHLogFile 2>&1
echo 'Installing Openssh-server' >> $configureSSHLogFile
docker exec iofog-agent apt-get install -y --fix-missing openssh-server >> $configureSSHLogFile 2>&1
echo 'Running apt-get install -fy' >> $configureSSHLogFile
docker exec iofog-agent apt-get install -fy >> $configureSSHLogFile 2>&1
echo 'Creating ~/.ssh' >> $configureSSHLogFile
docker exec iofog-agent mkdir -p /root/.ssh >> $configureSSHLogFile 2>&1
docker exec iofog-agent chmod 700 /root/.ssh >> $configureSSHLogFile 2>&1
echo 'Copying public key to ~/.ssh/authorized_keys' >> $configureSSHLogFile
docker cp test/conf/id_ecdsa.pub "$AGENT_CONTAINER_ID:/root/.ssh/authorized_keys" >> $configureSSHLogFile 2>&1
docker exec iofog-agent chmod 644 /root/.ssh/authorized_keys >> $configureSSHLogFile 2>&1
docker exec iofog-agent chown root:root /root/.ssh/authorized_keys >> $configureSSHLogFile 2>&1
echo 'Creating /var/run/.sshd' >> $configureSSHLogFile
docker exec iofog-agent mkdir -p /var/run/sshd >> $configureSSHLogFile 2>&1
echo 'Updating /etc/pam.d/sshd' >> $configureSSHLogFile
docker exec iofog-agent sudo sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd >> $configureSSHLogFile 2>&1
echo 'Updating /etc/ssh/sshd_config' >> $configureSSHLogFile
docker exec iofog-agent sudo sed 's@#AuthorizedKeysFile %h/.ssh/authorized_keys@AuthorizedKeysFile %h/.ssh/authorized_keys@g' -i /etc/ssh/sshd_config >> $configureSSHLogFile 2>&1
echo 'Restarting ssh service' >> $configureSSHLogFile
docker exec iofog-agent /bin/bash -c 'service ssh restart' >> $configureSSHLogFile 2>&1
echo 'Removing /var/lib/apt/lists/lock' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent sudo rm /var/lib/apt/lists/lock >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Updating apt-get' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent apt-get update -y >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Installing Openssh-server' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent apt-get install -y --fix-missing openssh-server >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Running apt-get install -fy' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent apt-get install -fy >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Creating ~/.ssh' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent mkdir -p /root/.ssh >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
docker exec iofog-agent chmod 700 /root/.ssh >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Copying public key to ~/.ssh/authorized_keys' >> "${CONFIGURE_SSH_LOG_FILE}"
docker cp test/conf/id_ecdsa.pub "$AGENT_CONTAINER_ID:/root/.ssh/authorized_keys" >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
docker exec iofog-agent chmod 644 /root/.ssh/authorized_keys >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
docker exec iofog-agent chown root:root /root/.ssh/authorized_keys >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Creating /var/run/.sshd' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent mkdir -p /var/run/sshd >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Updating /etc/pam.d/sshd' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent sudo sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Updating /etc/ssh/sshd_config' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent sudo sed 's@#AuthorizedKeysFile %h/.ssh/authorized_keys@AuthorizedKeysFile %h/.ssh/authorized_keys@g' -i /etc/ssh/sshd_config >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
echo 'Restarting ssh service' >> "${CONFIGURE_SSH_LOG_FILE}"
docker exec iofog-agent /bin/bash -c 'service ssh restart' >> "${CONFIGURE_SSH_LOG_FILE}" 2>&1
} || {
echoError "Failed to configure ssh on agent container"
cat $configureSSHLogFile
cat "${CONFIGURE_SSH_LOG_FILE}"
exit 1
}

Expand All @@ -88,6 +88,6 @@ docker run --rm --name test-runner --network local-iofog-network \
-e CONTROLLER="iofog-controller:51121" \
-e CONNECTOR="iofog-connector:8080" \
-e AGENTS="root@iofog-agent:22" \
iofog/test-runner:1.2
iofog/test-runner:1.3

echoNotify "## Test Runner Tests complete"

0 comments on commit 8188a48

Please sign in to comment.