buildall.sh 1.1 KB
Newer Older
Y
yi.wu 已提交
1 2
#!/bin/bash

Y
yi.wu 已提交
3
BUILD_DIR=$PWD/build
Y
yi.wu 已提交
4 5
DEB_DIST_DIR=$PWD/dist
VERSION=latest
Y
yi.wu 已提交
6 7

function build_in_docker() {
Y
yi.wu 已提交
8 9 10
  if [ ! -d $BUILD_DIR ]; then
    mkdir -p $BUILD_DIR
  fi
Y
yi.wu 已提交
11 12 13
  if [ ! -d $DEB_DIST_DIR ]; then
    mkdir -p $DEB_DIST_DIR
  fi
Y
yi.wu 已提交
14 15
  docker build . -t paddle-build-env -f paddle/scripts/docker/paddle-dev/Dockerfile
  # FIXME: need to wait a signal not sleeping
Y
yi.wu 已提交
16 17 18
  BUILDER=$(docker run -d -v ${PWD}:/root/paddle -v ${DEB_DIST_DIR}:/root/dist paddle-build-env sleep 3600)
  # NOTICE: build deb files for real paddle image
  docker exec $BUILDER /bin/bash -c "/root/paddle/paddle/scripts/deb/build_scripts/build.sh"
Y
yi.wu 已提交
19 20 21 22 23

  docker stop $BUILDER && docker rm $BUILDER
}

function build_paddle_core() {
24 25 26 27
  docker build . -t paddle:$VERSION -f paddle/scripts/docker/paddle-core/Dockerfile
  docker build . -t paddle:gpu-$VERSION -f paddle/scripts/docker/paddle-core/Dockerfile.gpu
  docker build . -t paddle:cpu-noavx-$VERSION -f paddle/scripts/docker/paddle-core/Dockerfile.noavx
  docker build . -t paddle:gpu-noavx-$VERSION -f paddle/scripts/docker/paddle-core/Dockerfile.gpunoavx
Y
yi.wu 已提交
28 29 30
}

build_in_docker
Y
yi.wu 已提交
31
build_paddle_core