Skip to content

Commit

Permalink
#159: Added psql 3rd party
Browse files Browse the repository at this point in the history
Summary:
- Added psql 3rd party dependency
- Added wrapper script for running from dev env like: `~/code/yugabyte/bin/psql`
- Included into release manifest

Test Plan:
- `ybd --sj`
- Run local cluster.
- `~/code/yugabyte/bin/psql -h localhost -p 5433` should work.
- Launch cluster in GCP.
- SSH to cluster node and try `~/tserver/bin/psql -h localhost -p 5433` as yugabyte user.

Reviewers: karthik, sid, mikhail, neil

Reviewed By: neil

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D4600
  • Loading branch information
ttyusupov committed Apr 12, 2018
1 parent 9ba8436 commit 91e6e02
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 2 deletions.
21 changes: 21 additions & 0 deletions bin/psql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# Copyright (c) YugaByte, Inc.
#
# Licensed 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.

# This is a wrapper around the redis-cli executable in the thirdparty directory. We are putting this
# in the "bin" directory of the source distribution for greater similarity in usage with YugaByte
# binary distribution.

. "${BASH_SOURCE%/*}"/../build-support/common-build-env.sh

exec "$YB_THIRDPARTY_DIR/installed/common/bin/psql" "$@"
37 changes: 37 additions & 0 deletions thirdparty/build_definitions/psql.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright (c) YugaByte, Inc.
#
# Licensed 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.
#

import multiprocessing
import os
import sys

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from build_definitions import *

class PSQLDependency(Dependency):
def __init__(self):
super(PSQLDependency, self).__init__(
'psql', '10.3', 'https://ftp.postgresql.org/pub/source/v{0}/postgresql-{0}.tar.gz',
BUILD_GROUP_COMMON)
self.dir = 'postgresql-{}'.format(self.version)
self.copy_sources = True

def build(self, builder):
log_prefix = builder.log_prefix(self)
args = ['./configure', '--prefix={}'.format(builder.prefix)]
log_output(log_prefix, args)
# Parallel build doesn't work for postgresql, fails intermittently.
log_output(log_prefix, ['make', '-C', 'src/interfaces/libpq', 'install'])
log_output(log_prefix, ['make', '-C', 'src/bin/psql', 'install'])
1 change: 1 addition & 0 deletions thirdparty/build_thirdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def __init__(self):
self.dependencies += [
build_definitions.cqlsh.CQLShDependency(),
build_definitions.redis_cli.RedisCliDependency(),
build_definitions.psql.PSQLDependency()
]

if is_linux():
Expand Down
1 change: 1 addition & 0 deletions thirdparty/thirdparty_src_checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da llvm-5.0.0.tar
c48450d27524c2e5856997133e059e3cf9909241110a6e21ad278890ac425afc lz4-r130.tar.gz
89e82cfe0b9f3851d929c73b04930dd16a73211ff87ad84330a349e906c9861f nvml-0.4-b2.tar.gz
c28dba8782da2cfea1e11c61d335958c31a9c1bc553063546af9cbe98f204092 protobuf-3.5.1.tar.gz
87584285af8c5fd6e599b4d9789f455f8cd55759ed81a9e575ebaebc7a03e796 psql-10.3.tar.gz
b3d7b214d1c1d791feb9494fd485730b233c8f744bd2bd30c00dd547927aeac4 python-2.7.10.tar.gz
9824a7906b9f742c34a205e552d7b8fcc4b2790832a6b1a14907e37f435328b0 redis_cli-4.0.1.tar.gz
8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab rapidjson-1.1.0.zip
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/version_for_jenkins_linux.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2018-04-04T14_20_38
2018-04-12T10_33_09
2 changes: 1 addition & 1 deletion thirdparty/version_for_jenkins_mac.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2018-04-04T22_33_40
2018-04-12T03_35_36
1 change: 1 addition & 0 deletions yb_release_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"thirdparty/installed/common/cqlsh/bin/cqlsh",
"thirdparty/installed/common/cqlsh/bin/cqlsh.py",
"thirdparty/installed/common/bin/redis-cli",
"thirdparty/installed/common/bin/psql",
"thirdparty/installed/uninstrumented/bin/pprof"],
"lib" : ["thirdparty/installed/common/cqlsh/lib/*"],
"pylib" : ["thirdparty/installed/common/cqlsh/pylib/*"],
Expand Down

0 comments on commit 91e6e02

Please sign in to comment.