You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/04/13 19:02:15 UTC

[pulsar] branch master updated: Improved MacOS Python build (#4039)

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 6544be5  Improved MacOS Python build (#4039)
6544be5 is described below

commit 6544be5ee3bed1e110d63731e075d4e4cf3f9c90
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sat Apr 13 12:02:11 2019 -0700

    Improved MacOS Python build (#4039)
    
    ### Motivation
    
    Fixed the Python wheels build on MacOS using vagrant.
     * Use images with pre-installed XCode and dependencies
     * Unified Py 2 and 3 in a single VM
---
 .gitignore                                         |  6 +-
 pulsar-client-cpp/python/pkg/osx/build.sh.template | 61 --------------------
 .../python/pkg/osx/generate-all-wheel.sh           | 56 +++++++++---------
 .../python/pkg/osx/osx-10.11-python2.7/Vagrantfile | 28 ---------
 .../pkg/osx/osx-10.11-python2.7/build.sh.template  |  1 -
 .../osx/osx-10.11-python2.7/generate-wheel-file.sh | 32 -----------
 .../python/pkg/osx/osx-10.11-python3.6/Vagrantfile | 28 ---------
 .../pkg/osx/osx-10.11-python3.6/build.sh.template  |  1 -
 .../osx/osx-10.11-python3.6/generate-wheel-file.sh | 32 -----------
 .../python/pkg/osx/osx-10.12-python2.7/Vagrantfile | 28 ---------
 .../pkg/osx/osx-10.12-python2.7/build.sh.template  |  1 -
 .../osx/osx-10.12-python2.7/generate-wheel-file.sh | 32 -----------
 .../python/pkg/osx/osx-10.12-python3.6/Vagrantfile | 28 ---------
 .../pkg/osx/osx-10.12-python3.6/build.sh.template  |  1 -
 .../osx/osx-10.12-python3.6/generate-wheel-file.sh | 32 -----------
 .../{osx-10.13-python2.7 => osx-10.12}/Vagrantfile |  6 +-
 .../pkg/osx/osx-10.13-python2.7/build.sh.template  |  1 -
 .../osx/osx-10.13-python2.7/generate-wheel-file.sh | 32 -----------
 .../pkg/osx/osx-10.13-python3.6/build.sh.template  |  1 -
 .../osx/osx-10.13-python3.6/generate-wheel-file.sh | 32 -----------
 .../{osx-10.13-python3.6 => osx-10.13}/Vagrantfile |  7 ++-
 .../python/pkg/osx/osx-10.14/Vagrantfile           |  9 +++
 pulsar-client-cpp/python/pkg/osx/vagrant-build.sh  | 67 ++++++++++++++++++++++
 23 files changed, 113 insertions(+), 409 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1baa025..fa63e5d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,10 +60,8 @@ deployment/terraform-ansible/aws/terraform.tfstate.backup
 **/.vagrant
 
 
-pulsar-client-cpp/python/pkg/osx/**/*.bak
-pulsar-client-cpp/python/pkg/osx/**/build.sh
-pulsar-client-cpp/python/pkg/osx/**/*.whl
-pulsar-client-cpp/python/pkg/osx/**/*.template2
+pulsar-client-cpp/python/pkg/osx/*/*.bak
+pulsar-client-cpp/python/pkg/osx/*/*.whl
 pulsar-client-cpp/python/wheelhouse
 
 # CI generated files
diff --git a/pulsar-client-cpp/python/pkg/osx/build.sh.template b/pulsar-client-cpp/python/pkg/osx/build.sh.template
deleted file mode 100755
index 7e8374e..0000000
--- a/pulsar-client-cpp/python/pkg/osx/build.sh.template
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-GITTAG=#TAG#
-PYTHONVER=#PYTHONVER#
-
-BOOST_VERSION=1.67
-
-/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
-brew install openssl git boost@$BOOST_VERSION pkg-config jsoncpp cmake protobuf260
-
-brew link --force boost@$BOOST_VERSION
-
-if [ "$PYTHONVER" = "PYTHON2" ]
-then
-	brew install python@2 boost-python@$BOOST_VERSION
-
-	brew link --force boost-python@$BOOST_VERSION
-fi
-
-if [ "$PYTHONVER" = "PYTHON3" ]
-then
-	brew install python boost-python3
-	brew link --force boost-python3
-fi
-
-brew link --force protobuf260
-
-rm -rf pulsar
-git clone --depth 1 --branch $GITTAG https://github.com/apache/pulsar.git
-cd pulsar/pulsar-client-cpp
-cmake . -DBUILD_TESTS=OFF -DLINK_STATIC=ON
-make _pulsar -j8
-cd python
-
-if [ "$PYTHONVER" = "PYTHON2" ]
-then
-  python2 setup.py bdist_wheel
-else
-  python3 setup.py bdist_wheel
-fi
diff --git a/pulsar-client-cpp/python/pkg/osx/generate-all-wheel.sh b/pulsar-client-cpp/python/pkg/osx/generate-all-wheel.sh
index 0e1dfec..b7fddb0 100755
--- a/pulsar-client-cpp/python/pkg/osx/generate-all-wheel.sh
+++ b/pulsar-client-cpp/python/pkg/osx/generate-all-wheel.sh
@@ -18,33 +18,33 @@
 # under the License.
 #
 
-
 set -e
 
-printf "== Generate python 2.7 osx packages ==\n"
-
-cd osx-10.11-python2.7
-sh generate-wheel-file.sh
-cd ..
-
-cd osx-10.12-python2.7
-sh generate-wheel-file.sh
-cd ..
-
-cd osx-10.13-python2.7
-sh generate-wheel-file.sh
-cd ..
-
-printf "== Generate python 3.6 osx packages ==\n"
-
-cd osx-10.11-python3.6
-sh generate-wheel-file.sh
-cd ..
-
-cd osx-10.12-python3.6
-sh generate-wheel-file.sh
-cd ..
-
-cd osx-10.13-python3.6
-sh generate-wheel-file.sh
-cd ..
\ No newline at end of file
+if [ "$#" -lt 1 ]; then
+    echo "Need to specify git tag as argument"
+    exit 1
+fi
+
+export GIT_TAG=$1
+export GIT_REPO=${2:-https://github.com/apache/pulsar.git}
+
+echo "GIT_TAG: '$GIT_TAG'"
+echo "GIT_REPO: '$GIT_REPO'"
+
+OSX_VERSIONS=(
+    osx-10.12
+    osx-10.13
+    osx-10.14
+)
+
+for osx in ${OSX_VERSIONS[@]}; do
+    echo ""
+    echo "------------- BUILDING PYTHON WHEELS FOR $osx ---------------------"
+
+    pushd $osx
+    rm -rf *.whl
+    vagrant up --provision
+    vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
+    vagrant halt -f
+    popd
+done
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/Vagrantfile
deleted file mode 100644
index 332b0ea..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/Vagrantfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "jhcook/osx-elcapitan-10.11"
-  config.vm.provision "shell", path: "build.sh", privileged: false
-  config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.11-python2.7"
-  end
-end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/generate-wheel-file.sh
deleted file mode 100755
index 53805db..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON2"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/Vagrantfile
deleted file mode 100644
index deb94bb..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/Vagrantfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "jhcook/osx-elcapitan-10.11"
-  config.vm.provision "shell", path: "build.sh", privileged: false
-  config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.11-python3.6"
-  end
-end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/generate-wheel-file.sh
deleted file mode 100755
index 560a824..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON3"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/Vagrantfile
deleted file mode 100644
index 297a5b8..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/Vagrantfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "jhcook/macos-sierra"
-  config.vm.provision "shell", path: "build.sh", privileged: false
-  config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.12-python2.7"
-  end
-end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/generate-wheel-file.sh
deleted file mode 100755
index 53805db..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON2"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/Vagrantfile
deleted file mode 100644
index 502c44f..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/Vagrantfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "jhcook/macos-sierra"
-  config.vm.provision "shell", path: "build.sh", privileged: false
-  config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.12-python3.6"
-  end
-end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/generate-wheel-file.sh
deleted file mode 100755
index 560a824..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON3"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.12/Vagrantfile
similarity index 82%
rename from pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/Vagrantfile
rename to pulsar-client-cpp/python/pkg/osx/osx-10.12/Vagrantfile
index 13b2646..b5f357f 100644
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/Vagrantfile
+++ b/pulsar-client-cpp/python/pkg/osx/osx-10.12/Vagrantfile
@@ -20,10 +20,10 @@
 #
 
 Vagrant.configure("2") do |config|
-  config.vm.box = "burinkhazad/macos-high-sierra"
-  config.vm.provision "shell", path: "build.sh", privileged: false
+  config.vm.box = "apachepulsar/osx-10.12-python-dev"
+  config.vm.provision "shell", path: "../vagrant-build.sh", privileged: false, args: [ENV["GIT_TAG"], ENV["GIT_REPO"]]
   config.vm.synced_folder ".", "/vagrant", disabled: true
   config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.13-python2.7"
+  	vb.name = "pulsar-python-osx-10.12"
   end
 end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/generate-wheel-file.sh
deleted file mode 100755
index 53805db..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python2.7/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON2"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/build.sh.template b/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/build.sh.template
deleted file mode 120000
index 1603003..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/build.sh.template
+++ /dev/null
@@ -1 +0,0 @@
-../build.sh.template
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/generate-wheel-file.sh b/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/generate-wheel-file.sh
deleted file mode 100755
index 560a824..0000000
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/generate-wheel-file.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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 -e
-
-gitTag="${gitTag:-master}"
-pythonVer="PYTHON3"
-
-rm -rf *.whl
-sed s/#TAG#/$gitTag/g build.sh.template > build.sh.template2
-sed s/#PYTHONVER#/$pythonVer/g build.sh.template2 > build.sh
-vagrant up --provision
-vagrant scp :/Users/vagrant/pulsar/pulsar-client-cpp/python/dist/*.whl .
-vagrant halt -f
\ No newline at end of file
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.13/Vagrantfile
similarity index 79%
rename from pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/Vagrantfile
rename to pulsar-client-cpp/python/pkg/osx/osx-10.13/Vagrantfile
index 5bfc25b..b630ce0 100644
--- a/pulsar-client-cpp/python/pkg/osx/osx-10.13-python3.6/Vagrantfile
+++ b/pulsar-client-cpp/python/pkg/osx/osx-10.13/Vagrantfile
@@ -20,10 +20,11 @@
 #
 
 Vagrant.configure("2") do |config|
-  config.vm.box = "burinkhazad/macos-high-sierra"
-  config.vm.provision "shell", path: "build.sh", privileged: false
+  config.vm.box = "apachepulsar/osx-10.13-python-dev"
+  config.vm.box_version = "0.2"
+  config.vm.provision "shell", path: "../vagrant-build.sh", privileged: false, args: [ENV["GIT_TAG"], ENV["GIT_REPO"]]
   config.vm.synced_folder ".", "/vagrant", disabled: true
   config.vm.provider :virtualbox do |vb|
-  	vb.name = "osx-10.13-python3.6"
+  	vb.name = "pulsar-python-osx-10.13"
   end
 end
diff --git a/pulsar-client-cpp/python/pkg/osx/osx-10.14/Vagrantfile b/pulsar-client-cpp/python/pkg/osx/osx-10.14/Vagrantfile
new file mode 100644
index 0000000..cc7a808
--- /dev/null
+++ b/pulsar-client-cpp/python/pkg/osx/osx-10.14/Vagrantfile
@@ -0,0 +1,9 @@
+Vagrant.configure("2") do |config|
+  config.vm.box = "apachepulsar/osx-10.14-python-dev"
+  config.vm.box_version = "0.2"
+  config.vm.provision "shell", path: "../vagrant-build.sh", privileged: false, args: [ENV["GIT_TAG"], ENV["GIT_REPO"]]
+  config.vm.synced_folder ".", "/vagrant", disabled: true
+  config.vm.provider :virtualbox do |vb|
+  	vb.name = "pulsar-python-osx-10.14"
+  end
+end
diff --git a/pulsar-client-cpp/python/pkg/osx/vagrant-build.sh b/pulsar-client-cpp/python/pkg/osx/vagrant-build.sh
new file mode 100644
index 0000000..dde130e
--- /dev/null
+++ b/pulsar-client-cpp/python/pkg/osx/vagrant-build.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+if [ "$#" -ne 2 ]; then
+    echo "Need to specify git tag and repo as argument"
+    exit 1
+fi
+
+GIT_TAG=$1
+GIT_REPO=$2
+
+set -e -x
+
+rm -rf pulsar
+git clone -q --depth 1 --branch $GIT_TAG $GIT_REPO
+cd pulsar/pulsar-client-cpp
+
+brew link --force boost
+brew link --force protobuf260 || true ## Older images have protobuf 2.6.0 and not linked
+
+# Python 2
+brew unlink python
+brew unlink boost-python3
+brew link --force python@2
+brew link --force boost-python
+
+cmake . -DBUILD_TESTS=OFF \
+		-DLINK_STATIC=ON  \
+		-DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
+make _pulsar -j8
+pushd python
+python2 setup.py bdist_wheel
+popd
+
+#### Python 3
+brew unlink python@2
+brew unlink boost-python
+brew link --force python
+brew link --force boost-python3
+
+make clean
+rm CMakeCache.txt
+cmake . -DBUILD_TESTS=OFF \
+		-DLINK_STATIC=ON  \
+		-DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib \
+        -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/3.7/include/python3.7m
+make _pulsar -j8
+pushd python
+python3 setup.py bdist_wheel
+popd