Skip to content

Commit

Permalink
BIGTOP-2922: Drop arch specific bigtop-* images
Browse files Browse the repository at this point in the history
Use unified Dockerfile for puppet/slaves images on different architectures.
Simplified the build process, and add gradle tasks for them.
Example: ./gradlew -POS=debian-9 -Pprefix=1.2.1 bigtop-puppet
         ./gradlew -POS=debian-9 -Pprefix=1.2.1 bigtop-slaves
This will create proper images with same image name as existings on different
HW architectures. This eases efforts for deploy and test.

Change-Id: I183452324faf54808a4e88981d604d8fe119b51a
Signed-off-by: Jun He <[email protected]>
Signed-off-by: Evans Ye <[email protected]>
  • Loading branch information
Jun He authored and evans-ye committed Feb 10, 2018
1 parent 71aa643 commit f3fc077
Show file tree
Hide file tree
Showing 32 changed files with 125 additions and 552 deletions.
24 changes: 18 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,33 @@ task "configure-nexus"(dependsOn: tasks.findAll { alltask -> alltask.name.starts
writer.append("</mirrors></settings>")
}

task "bigtop-puppet"(type:Exec,
description: 'Build bigtop/puppet images.\n' +
'Usage:\n $ ./gradlew -POS=[centos-7|fedora-26|debian-9|ubuntu-16.04|opensuse-42.3] -Pprefix=STRING_TO_PREFIX bigtop-puppet\n' +
'Example:\n $ ./gradlew -POS=debian-9 -Pprefix=1.0.0 bigtop-puppet\n' +
'The built image name: bigtop/puppet:1.0.0-debian-9',
group: DOCKERBUILD_GROUP) {
def _prefix = project.hasProperty("prefix") ? prefix : "trunk"
def _OS = project.hasProperty("OS") ? OS : "centos-7"
def command = [
'./build.sh', _prefix + '-' + _OS,
]
workingDir './docker/bigtop-puppet'
commandLine command
}

task "bigtop-slaves"(type:Exec,
description: 'Build bigtop/slaves images.\n' +
'Usage:\n $ ./gradlew -POS=[centos-7|fedora-26|debian-9|ubuntu-16.04|opensuse-42.3] -Pprefix=STRING_TO_PREFIX bigtop-slaves\n' +
'Example:\n $ ./gradlew -POS=debian-9 -Pprefix=1.0.0 bigtop-slaves\n' +
'The built image name: bigtop/slaves:1.0.0-debian-8',
'The built image name: bigtop/slaves:1.0.0-debian-9',
group: DOCKERBUILD_GROUP) {
def _prefix = project.hasProperty("prefix") ? prefix : "trunk"
def _OS = project.hasProperty("OS") ? OS : "centos-7"
def command = [
'docker', 'build',
'-t', 'bigtop/slaves:' + _prefix + '-' + _OS,
'-f', "docker/bigtop-slaves/" + _OS + "/Dockerfile",
'.'
'./build.sh', _prefix + '-' + _OS,
]
workingDir '.'
workingDir './docker/bigtop-slaves'
commandLine command
}

Expand Down
35 changes: 32 additions & 3 deletions docker/bigtop-puppet/fedora-26/Dockerfile → docker/bigtop-puppet/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,38 @@
# 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.
FROM fedora:26
MAINTAINER [email protected]

COPY puppetize.sh /tmp/puppetize.sh
#!/bin/sh

set -ex

if [ $# != 1 ]; then
echo "Creates bigtop/puppet image"
echo
echo "Usage: build.sh <PREIX-OS-VERSION>"
echo
echo "Example: build.sh trunk-centos-7"
echo " : build.sh 1.0.0-centos-7"
exit 1
fi

PREFIX=$(echo "$1" | cut -d '-' -f 1)
OS=$(echo "$1" | cut -d '-' -f 2)
VERSION=$(echo "$1" | cut -d '-' -f 3)
ARCH=$(uname -m)
if [ "${ARCH}" != "x86_64" ];then
ARCH="-${ARCH}"
else
ARCH=""
fi

cp ../../bigtop_toolchain/bin/puppetize.sh .
cat >Dockerfile <<EOF
FROM ${OS}:${VERSION}
MAINTAINER [email protected]
COPY puppetize.sh /tmp/puppetize.sh
RUN bash /tmp/puppetize.sh
EOF

docker build -t bigtop/puppet:${PREFIX}-${OS}-${VERSION}${ARCH} .
rm -f Dockerfile puppetize.sh
20 changes: 0 additions & 20 deletions docker/bigtop-puppet/centos-7/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/centos-7/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/debian-9-aarch64/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/debian-9-aarch64/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/debian-9/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/debian-9/build.sh

This file was deleted.

19 changes: 0 additions & 19 deletions docker/bigtop-puppet/fedora-26-aarch64/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/fedora-26-aarch64/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/fedora-26-ppc64le/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/fedora-26-ppc64le/build.sh

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/fedora-26/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/opensuse-42.3/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/opensuse-42.3/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/ubuntu-16.04-aarch64/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions docker/bigtop-puppet/ubuntu-16.04-aarch64/build.sh

This file was deleted.

20 changes: 0 additions & 20 deletions docker/bigtop-puppet/ubuntu-16.04-ppc64le/Dockerfile

This file was deleted.

Loading

0 comments on commit f3fc077

Please sign in to comment.