storlets/bin/init_container.sh
Eran Rom 96027448c0 Getting all storlet related code out of the container
One of the biggest hurdles in the storlets devops code
is the need to update the container image each time
the storlet related code changes.

A previous patch [1] already made sure that
all the container necessary code is installed on the host
machine in:
/usr/local/lib/storlets
/usr/local/lib/python2.7/dist-packages/storlets

This patch completes the work by:
1. Treat the scripts daemon, daemon-factory, init_container.sh
   accordingly: placing them in /usr/local/libexec/storlets
2. Mount the above-mentioned dirs in ro mode
3. Cleanup the ansible code that installs everything
   in the container image
4. Update the installation docs accordingly

[1] https://review.openstack.org/#/c/370332/

Change-Id: I7da46c1554df2bbbff2ccff12d82d8fbe158aa22

Getting all storlet related code out of the container

One of the biggest hurdles in the storlets devops code
is the need to update the container image each time
the storlet related code changes.

A previous patch [1] already made sure that
all the container necessary code is installed on the host
machine in:
/usr/local/lib/storlets
/usr/local/lib/python2.7/dist-packages/storlets

This patch completes the work by:
1. Treat the scripts daemon, daemon-factory, init_container.sh
   accordingly: placing them in /opt/storlets/bin
2. Mount the above-mentioned dirs in ro mode
3. Cleanup the ansible code that installs everything
   in the container image
4. Update the installation docs accordingly

[1] https://review.openstack.org/#/c/370332/

Change-Id: I7da46c1554df2bbbff2ccff12d82d8fbe158aa22
2017-09-15 10:05:42 +03:00

32 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright IBM Corp. 2015, 2015 All Rights Reserved
# Copyright (c) 2010-2016 OpenStack Foundation
#
# 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.
# This script is the our docker ENTRYPOINT
# $1 determines between debug mode running mode
# For debug mode $2 is a command to execute
# Otherwise $2,$3 are as follows
# $2 is the path to the factory pipe , e.g. /channels/factory_pipe
# This path must be mapped by docker run -v option
# $3 is assumed to be the factory debug level, e.g. DEBUG
if [ $1 == "debug" ]; then
$2
else
/usr/local/libexec/storlets/storlets-daemon-factory $2 $3 $HOSTNAME
fi