Skip to content

Commit

Permalink
Add pulsar python client osx vagrant templates (apache#1919)
Browse files Browse the repository at this point in the history
* Add pulsar python client osx vagrant templates

* Change file name and aggregate build

* Change file name and aggregate build

* Move file location

* Update license

* Add Header to reaminging files
  • Loading branch information
aahmed-se authored and merlimat committed Jun 6, 2018
1 parent 5f7e367 commit e30dd35
Show file tree
Hide file tree
Showing 21 changed files with 474 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pulsar-broker/src/test/resources/log4j2.yaml
*.iws

# Mac
.DS_Store
**/.DS_Store

# VisualStudioCode artifacts
.vscode/
Expand Down Expand Up @@ -54,3 +54,11 @@ deployment/terraform-ansible/aws/terraform.tfstate.backup

# Vagrant
**/.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


47 changes: 47 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/build.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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#

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install openssl git boost pkg-config jsoncpp cmake protobuf260 log4cxx

if [ "$PYTHONVER" = "PYTHON2" ]
then
brew install python@2 boost-python
fi

if [ "$PYTHONVER" = "PYTHON3" ]
then
brew install python boost-python3
fi

brew link --force protobuf260
rm -rf incubator-pulsar
git clone --depth 1 --branch $GITTAG https://github.com/apache/incubator-pulsar.git
cd incubator-pulsar/pulsar-client-cpp
cmake . -DBUILD_TESTS=OFF -DLINK_STATIC=ON
make _pulsar -j8
cd python
python setup.py bdist_wheel
50 changes: 50 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/generate-all-wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/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

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 ..
28 changes: 28 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/osx-10.11-python2.7/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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/incubator-pulsar/pulsar-client-cpp/python/dist/*.whl .
vagrant halt -f
28 changes: 28 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/osx-10.11-python3.6/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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/incubator-pulsar/pulsar-client-cpp/python/dist/*.whl .
vagrant halt -f
28 changes: 28 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/osx-10.12-python2.7/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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/incubator-pulsar/pulsar-client-cpp/python/dist/*.whl .
vagrant halt -f
28 changes: 28 additions & 0 deletions pulsar-client-cpp/python/pkg/osx/osx-10.12-python3.6/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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/incubator-pulsar/pulsar-client-cpp/python/dist/*.whl .
vagrant halt -f
Loading

0 comments on commit e30dd35

Please sign in to comment.