Update makefile with run commands
Set up and do a rudimentary test of the images created by the shipyard project to see if the images are okish. Change-Id: I1f1c8fbcfeeafff66764ae99a176ff6a6766edce
This commit is contained in:
parent
9f2bbdbd26
commit
93877bbcc3
11
Makefile
11
Makefile
|
@ -41,8 +41,19 @@ dry-run: clean
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
docs: clean build_docs
|
docs: clean build_docs
|
||||||
|
|
||||||
|
.PHONY: run_images
|
||||||
|
run_images: run_shipyard run_airflow
|
||||||
|
|
||||||
# Make targets intended for use by the primary targets above.
|
# Make targets intended for use by the primary targets above.
|
||||||
|
|
||||||
|
.PHONY: run_shipyard
|
||||||
|
run_shipyard: clean build_shipyard
|
||||||
|
tools/shipyard_image_run.sh $(IMAGE_PREFIX) $(SHIPYARD_IMAGE_NAME) $(IMAGE_TAG)
|
||||||
|
|
||||||
|
.PHONY: run_airflow
|
||||||
|
run_airflow: clean build_airflow
|
||||||
|
tools/airflow_image_run.sh $(IMAGE_PREFIX) $(AIRFLOW_IMAGE_NAME) $(IMAGE_TAG)
|
||||||
|
|
||||||
.PHONY: build_airflow
|
.PHONY: build_airflow
|
||||||
build_airflow:
|
build_airflow:
|
||||||
docker build -t $(IMAGE_PREFIX)/$(AIRFLOW_IMAGE_NAME):$(IMAGE_TAG) images/airflow/
|
docker build -t $(IMAGE_PREFIX)/$(AIRFLOW_IMAGE_NAME):$(IMAGE_TAG) images/airflow/
|
||||||
|
|
|
@ -61,6 +61,11 @@ RUN set -ex && \
|
||||||
# Install Armada libraries
|
# Install Armada libraries
|
||||||
COPY ./requirements.txt /tmp/
|
COPY ./requirements.txt /tmp/
|
||||||
RUN pip3 install -r /tmp/requirements.txt
|
RUN pip3 install -r /tmp/requirements.txt
|
||||||
|
|
||||||
|
# Note - removing snakebite (python 2 vs. 3). See:
|
||||||
|
# https://github.com/puckel/docker-airflow/issues/77
|
||||||
|
RUN pip3 uninstall -y snakebite || true
|
||||||
|
|
||||||
RUN pip3 install -e git://github.com/att-comdev/drydock.git#egg=drydock_provisioner
|
RUN pip3 install -e git://github.com/att-comdev/drydock.git#egg=drydock_provisioner
|
||||||
RUN pip3 install -e git://github.com/att-comdev/armada.git#egg=armada
|
RUN pip3 install -e git://github.com/att-comdev/armada.git#egg=armada
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,17 @@ elif [[ $cmd == *scheduler* ]]; then
|
||||||
airflow_cmd="/usr/bin/python3 /usr/local/bin/airflow scheduler $2 $3"
|
airflow_cmd="/usr/bin/python3 /usr/local/bin/airflow scheduler $2 $3"
|
||||||
eval $airflow_cmd
|
eval $airflow_cmd
|
||||||
done
|
done
|
||||||
|
elif [[ $cmd == 'quicktest' ]]; then
|
||||||
|
test_cmd="/usr/bin/python3 /usr/local/bin/airflow initdb"
|
||||||
|
eval $test_cmd
|
||||||
|
test_cmd2="/usr/bin/python3 /usr/local/bin/airflow webserver -p 8080 &"
|
||||||
|
eval $test_cmd2
|
||||||
|
test_cmd3="airflow run example_bash_operator runme_0 2015-01-01"
|
||||||
|
eval $test_cmd3
|
||||||
|
test_cmd4="airflow backfill example_bash_operator -s 2015-01-01 -e 2015-01-02"
|
||||||
|
eval $test_cmd4
|
||||||
|
test_cmd5="airflow dag_state example_bash_operator 2015-01-01"
|
||||||
|
eval $test_cmd5
|
||||||
else
|
else
|
||||||
echo "Invalid Command!"
|
echo "Invalid Command!"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
set -x
|
||||||
|
|
||||||
|
IMAGE_PREFIX=$1
|
||||||
|
AIRFLOW_IMAGE_NAME=$2
|
||||||
|
IMAGE_TAG=$3
|
||||||
|
|
||||||
|
TEST_RESP="$(docker run \
|
||||||
|
-p 8080:8080 \
|
||||||
|
--name airflow_test ${IMAGE_PREFIX}/${AIRFLOW_IMAGE_NAME}:${IMAGE_TAG} \
|
||||||
|
quicktest)"
|
||||||
|
|
||||||
|
docker stop airflow_test
|
||||||
|
docker rm airflow_test
|
||||||
|
|
||||||
|
if [[ ${TEST_RESP:(-7)} == "success" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -0,0 +1,42 @@
|
||||||
|
# A fake configuration file with default/fake values specified for use in
|
||||||
|
# basic testing of the Shipyard image
|
||||||
|
[armada]
|
||||||
|
service_type = armada
|
||||||
|
[base]
|
||||||
|
postgresql_airflow_db = postgresql+psycopg2://airflow:password@postgresql.ucp.svc.cluster.local:5432/airflow
|
||||||
|
postgresql_db = postgresql+psycopg2://shipyard:password@postgresql.ucp.svc.cluster.local:5432/shipyard
|
||||||
|
web_server = http://airflow-web-int.ucp.svc.cluster.local:8080/
|
||||||
|
upgrade_db = false
|
||||||
|
[deckhand]
|
||||||
|
service_type = deckhand
|
||||||
|
[drydock]
|
||||||
|
cluster_join_check_backoff_time = 120
|
||||||
|
deploy_node_query_interval = 30
|
||||||
|
deploy_node_task_timeout = 3600
|
||||||
|
prepare_node_query_interval = 30
|
||||||
|
prepare_node_task_timeout = 1800
|
||||||
|
prepare_site_query_interval = 10
|
||||||
|
prepare_site_task_timeout = 120
|
||||||
|
service_type = physicalprovisioner
|
||||||
|
verify_site_query_interval = 10
|
||||||
|
verify_site_task_timeout = 60
|
||||||
|
[healthcheck]
|
||||||
|
endpoint = /api/v1.0/health
|
||||||
|
schema = http
|
||||||
|
[keystone_authtoken]
|
||||||
|
auth_section = keystone_authtoken
|
||||||
|
auth_type = password
|
||||||
|
auth_uri = http://keystone-api.ucp.svc.cluster.local:80/v3
|
||||||
|
auth_url = http://keystone-api.ucp.svc.cluster.local:80/v3
|
||||||
|
auth_version = v3
|
||||||
|
delay_auth_decision = true
|
||||||
|
memcache_secret_key = secret
|
||||||
|
memcache_security_strategy = None
|
||||||
|
memcached_servers = memcached.ucp.svc.cluster.local:11211
|
||||||
|
password = password
|
||||||
|
project_domain_name = default
|
||||||
|
project_name = service
|
||||||
|
user_domain_name = default
|
||||||
|
username = shipyard
|
||||||
|
[shipyard]
|
||||||
|
service_type = shipyard
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
set -x
|
||||||
|
|
||||||
|
IMAGE_PREFIX=$1
|
||||||
|
SHIPYARD_IMAGE_NAME=$2
|
||||||
|
IMAGE_TAG=$3
|
||||||
|
|
||||||
|
# Collect necessary files and run shipyard image in docker
|
||||||
|
mkdir -p build/.tmprun/etc
|
||||||
|
cp $PWD/etc/shipyard/api-paste.ini build/.tmprun/etc
|
||||||
|
cp $PWD/tools/resources/shipyard.conf build/.tmprun/etc
|
||||||
|
docker run \
|
||||||
|
-v $PWD/build/.tmprun/etc:/etc/shipyard \
|
||||||
|
-p 9000:9000 \
|
||||||
|
--name shipyard_test ${IMAGE_PREFIX}/${SHIPYARD_IMAGE_NAME}:${IMAGE_TAG} \
|
||||||
|
&
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
RESULT="$(curl -i 'http://127.0.0.1:9000/versions' | tr '\r' '\n' | head -1)"
|
||||||
|
|
||||||
|
docker stop shipyard_test
|
||||||
|
docker rm shipyard_test
|
||||||
|
rm -r build/.tmprun
|
||||||
|
|
||||||
|
GOOD="HTTP/1.1 200 OK"
|
||||||
|
if [[ ${RESULT} == ${GOOD} ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
Reference in New Issue