Skip to content

Commit

Permalink
grakn-core-all RPM package (typedb#5070)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?

Adds `grakn-core-all` (`bazel build //:assemble-linux-rpm`) : virtual package to install both `server` and `console`

## What are the changes implemented in this PR?

- Adds `//:assemble-linux-rpm` and `//:deploy-rpm` targets
- Adds `.spec` file to build `grakn-core-all`
- Introduces exact version dependencies between `console`/`server` and `bin`
- Deploys and installs `grakn-core-all` on `test-deployment`
  • Loading branch information
vmax authored and haikalpribadi committed Mar 28, 2019
1 parent e189161 commit 719d8fe
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ jobs:
- install-bazel-linux-rbe
- checkout
- run: sudo apt install rpm
- run: echo $(cat VERSION)-$CIRCLE_SHA1 > VERSION && sed -i -e 's/-/_/g' VERSION && cat VERSION
- run: echo $(cat VERSION)-$CIRCLE_SHA1 > VERSION && cat VERSION
- run: |
export DEPLOY_RPM_USERNAME=$REPO_GRAKN_USERNAME
export DEPLOY_RPM_PASSWORD=$REPO_GRAKN_PASSWORD
bazel run //bin:deploy-rpm -- snapshot
bazel run //server:deploy-rpm -- snapshot
bazel run //console:deploy-rpm -- snapshot
# bazel run //:deploy-rpm -- snapshot TODO: we need to deploy grakn-server-all for RPM
bazel run //:deploy-rpm -- snapshot
- run: cp VERSION VERSION.rpm
- persist_to_workspace:
root: ~/grakn
Expand Down
13 changes: 13 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ assemble_zip(
visibility = ["//visibility:public"]
)

assemble_rpm(
name = "assemble-linux-rpm",
package_name = "grakn-core-all",
version_file = "//:VERSION",
spec_file = "//config/rpm:grakn-core-all.spec",
)

deploy_rpm(
name = "deploy-rpm",
target = ":assemble-linux-rpm",
deployment_properties = "@graknlabs_build_tools//:deployment.properties",
)

container_image(
name = "assemble-docker",
base = "@openjdk_image//image",
Expand Down
2 changes: 1 addition & 1 deletion config/rpm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

exports_files(["grakn-core-bin.spec", "grakn-core-console.spec", "grakn-core-server.spec"])
exports_files(["grakn-core-bin.spec", "grakn-core-console.spec", "grakn-core-server.spec", "grakn-core-all.spec"])
22 changes: 22 additions & 0 deletions config/rpm/grakn-core-all.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Name: grakn-core-all
Version: devel
Release: 1
Summary: Grakn Core (all)
URL: https://grakn.ai
License: Apache License, v2.0
AutoReqProv: no

Requires: grakn-core-server = %{version}
Requires: grakn-core-console = %{version}

%description
Grakn Core (all) - virtual package which installs both Grakn Core Server and Grakn Core Console

%prep

%build

%install

%files

2 changes: 1 addition & 1 deletion config/rpm/grakn-core-console.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AutoReqProv: no
Source0: {_grakn-core-console-rpm-tar.tar.gz}

Requires: java-1.8.0-openjdk-headless
Requires: grakn-core-bin
Requires: grakn-core-bin = %{version}

%description
Grakn Core (server) - description
Expand Down
2 changes: 1 addition & 1 deletion config/rpm/grakn-core-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AutoReqProv: no
Source0: {_grakn-core-server-rpm-tar.tar.gz}

Requires: java-1.8.0-openjdk-headless
Requires: grakn-core-bin
Requires: grakn-core-bin = %{version}

%description
Grakn Core (server) - description
Expand Down
4 changes: 1 addition & 3 deletions test/deployment/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ def gcloud_instances_delete(instance):
lprint('Installing RPM packages. Grakn will be available system-wide')
gcloud_ssh(instance, 'sudo yum-config-manager --add-repo https://repo.grakn.ai/repository/meta/rpm-snapshot.repo')
gcloud_ssh(instance, 'sudo yum -y update')
gcloud_ssh(instance, 'sudo yum -y install grakn-core-bin-$(cat VERSION)')
gcloud_ssh(instance, 'sudo yum -y install grakn-core-server-$(cat VERSION)')
gcloud_ssh(instance, 'sudo yum -y install grakn-core-console-$(cat VERSION)')
gcloud_ssh(instance, 'sudo yum -y install grakn-core-all-$(cat VERSION)')

gcloud_ssh(instance, 'grakn server start')
gcloud_ssh(instance, 'grakn server stop')
Expand Down

0 comments on commit 719d8fe

Please sign in to comment.