Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scripts] Fix bin/ycsb for Python 2.6 and bin/ycsb check_output #709

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

risdenk
Copy link
Collaborator

@risdenk risdenk commented Apr 13, 2016

Fix checking of argparse module and custom check_output to not return None for err.output.

Fixes #708

@risdenk
Copy link
Collaborator Author

risdenk commented Apr 13, 2016

I didn't get to try this on Windows. I tried this with the following against the basic db.

YCSB commands

./bin/ycsb load basic -P workloads/workloada
./bin/ycsb run basic -P workloads/workloada

Ubuntu 14.04

docker run --rm -it ubuntu bash

apt-get update && apt-get install -y --no-install-recommends maven git openjdk-7-jdk python

git clone https://github.com/brianfrankcooper/YCSB.git /opt/YCSB
cd /opt/YCSB

root@6ad3791ae749:/opt/YCSB# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
root@6ad3791ae749:/opt/YCSB# mvn --version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_95, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.4.6", arch: "amd64", family: "unix"
root@6ad3791ae749:/opt/YCSB# python --version
Python 2.7.6

CentOS 6

docker run --rm -it centos:6 bash

yum -y install git java-1.7.0-openjdk-devel wget epel-release && wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo && yum -y install apache-maven python-pip && pip install argparse

git clone https://github.com/brianfrankcooper/YCSB.git /opt/YCSB
cd /opt/YCSB

[root@ae00a45c61fd YCSB]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[root@ae00a45c61fd YCSB]# mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T11:57:37+00:00)
Maven home: /usr/share/apache-maven
Java version: 1.7.0_99, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.99.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.4.6", arch: "amd64", family: "unix"
[root@ae00a45c61fd YCSB]# python --version
Python 2.6.6

@busbey busbey changed the title Fix bin/ycsb for Python 2.6 and bin/ycsb check_output [scripts] Fix bin/ycsb for Python 2.6 and bin/ycsb check_output Apr 16, 2016
if p.returncode:
raise subprocess.CalledProcessError(p.returncode, cmd)
return stdout
# From https://gist.github.com/edufelipe/1027906
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to know the license for the backport. I'll leave a comment on the gist

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to pull straight from the source instead?

https://github.com/python/cpython/blob/2.7/Lib/subprocess.py#L545

It would be under the license here: https://github.com/python/cpython/blob/2.7/LICENSE

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it till Tuesday or Wednesday for the gist author to respond.

@busbey
Copy link
Collaborator

busbey commented Apr 17, 2016

it fails on windows the same way it used to fail on windows, so no worries there. :)

@busbey
Copy link
Collaborator

busbey commented Apr 29, 2016

two weeks is a long time for no response. which one of us should do the reimplementation? :)

@risdenk
Copy link
Collaborator Author

risdenk commented Apr 29, 2016

@busbey I think I should have time to update this today.

@risdenk
Copy link
Collaborator Author

risdenk commented Apr 29, 2016

@busbey updated the check_output method using the one from Python. Minor modifications like adding subprocess. before a few items and fixing the CalledProcessError output. Tested on Ubuntu and CentOS again as outlined above.

@busbey
Copy link
Collaborator

busbey commented Apr 29, 2016

+1, presuming travis checks go fine (I don't think this changes anything they cover anyways).

@risdenk risdenk merged commit 0d3c5b0 into brianfrankcooper:master Apr 29, 2016
@risdenk
Copy link
Collaborator Author

risdenk commented Apr 29, 2016

Thanks @busbey Travis passed

@risdenk risdenk deleted the fix-ycsb-python-2.6 branch April 29, 2016 18:25
@ghost ghost mentioned this pull request May 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants