Skip to content

Commit 2cf3194

Browse files
authored
Merge pull request #7 from jhanna-kx/jimdigriz-getlic
Jimdigriz getlic
2 parents a9b4a61 + 990f152 commit 2cf3194

File tree

4 files changed

+91
-84
lines changed

4 files changed

+91
-84
lines changed

.travis.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
11
language: c
2-
32
os:
4-
- linux
5-
- osx
6-
3+
- linux
4+
- osx
75
git:
86
depth: 1
9-
107
script:
11-
- export PROJECT=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f2-)
12-
- if [ $TRAVIS_OS_NAME = linux ]; then QLIBDIR=l64; elif [ $TRAVIS_OS_NAME = osx ]; then QLIBDIR=m64; else echo "unknown OS ('$TRAVIS_OS_NAME')" >&2; exit 1; fi; export QLIBDIR
13-
- make $QLIBDIR/p.so
14-
- tar czf ${PROJECT}_${TRAVIS_TAG}_${TRAVIS_OS_NAME}.tgz LICENSE p.q p.k $QLIBDIR/p.so
15-
8+
- make p.so
9+
- echo "Preparing version $TRAVIS_BRANCH-$TRAVIS_COMMIT"
10+
- tar czf embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz p.q p.k test.q tests [ml]64/p.so LICENSE README.md
11+
- echo "Packaged as embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip"
12+
compiler:
13+
- clang
1614
deploy:
1715
provider: releases
18-
api_key: $GITHUB_OAUTH_TOKEN
19-
file: ${PROJECT}_${TRAVIS_TAG}_${TRAVIS_OS_NAME}.tgz
16+
api_key: "$GITHUB_APIKEY"
17+
file_glob: true
18+
file: embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz
2019
skip_cleanup: true
2120
on:
2221
tags: true
23-
2422
jobs:
2523
include:
2624
- stage: docker
2725
sudo: required
2826
services:
2927
- docker
3028
script:
31-
- eval ${DOCKER_IMAGE:+docker build -t $DOCKER_IMAGE -f docker/Dockerfile .}
29+
- docker build -t kxsys/embedpy:latest -f docker/Dockerfile .
30+
- docker tag kxsys/embedpy:latest kxsys/embedpy:$TRAVIS_BRANCH
3231
deploy:
3332
provider: script
34-
script: eval ${DOCKER_IMAGE:+echo $DOCKER_API_KEY | docker login --username $DOCKER_USERNAME --password-stdin && docker push $DOCKER_IMAGE}
33+
script:
34+
- echo $DOCKER_PASSWORD|docker login --username $DOCKER_USERNAME --password-stdin && docker push kxsys/embedpy:latest && docker push kxsys/embedpy:$TRAVIS_BRANCH
3535
skip_cleanup: true
3636
on:
3737
tags: true
38+
condition: $TRAVIS_BRANCH =~ ^[0-9]+\.
39+
notifications:
40+
slack:
41+
secure: "MR5icOywJJSFy7gnxeNXACN2nKiHniVgX1myiF+H9U4wsW6+2BHzPMcmy3FIUjL3Tb+PcAfq7+8RHerAx/XEB7nsVJsu9TyCjYWgaqx5Z9WNIDcjQh4wnFurhlzqrwF4gjelY+wxdffpsKUVaP+fermWbqHvv1aPPk4l3xEonXZ5J5uNkPTPufILzpx2cTxWg08o6PhvgjTrombs+9rGxahU8cfUSwTVuPCcPtOy70kcaowFfrU2kWzQk88NM5d/TVZdkOmGhLqVWSvRgaLXFkGYwRWatT7divlXX2evYwdYib++RUUhxDGZwJjdFCbGDNjrMyBbJOrCkndxLSATd6gN76dWuWsVV49K4YB0Mw5uFJFt6J0TnbkJC5Zsl9i6vik7m3anuIPOeAI54/wtlCvMeIpt2eQCPMy7xXu2hXNUR4ofM4yaVjKz69b5JIZ1o3vBxPQxAqIYggqPsTaLJM4vLpZlncnViBkfO/La5V9sJNQy3IyLSlEKry3giYfo8wbHT3PLn1xG7HW2DJ7hRn19yzTkCCNfaSzvq8YlSQvjNlPCO566ykYYG6SzG/NnbDqJAqydhpFuNC7ZB5dPuAOoDANCGs4gtfYKia+ZVxKYn25Y52vdi34L5TO83BUrsQWgytb0J6a4jDe3PWLVFSP7XLiy4h8Tyv76+Hm4lHk="

README.md

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -67,49 +67,7 @@ If you have [Docker installed](https://www.docker.com/community-edition) you can
6767

6868
q)
6969

70-
For subsequent runs, you will not be prompted to redo the license setup when calling:
71-
72-
$ docker start -ai myembedpy
73-
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
74-
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 [email protected] KOD #0000000
75-
76-
q)
77-
78-
If you prefer to drop straight into `bash` you can with:
79-
80-
$ docker run -it kxsys/embedpy bash
81-
[snipped license setup]
82-
kx@8ac226623908:~$ conda info
83-
84-
active environment : kx
85-
active env location : /home/kx/.conda/envs/kx
86-
[snipped]
87-
kx@8ac226623908:~$ q
88-
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
89-
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 [email protected] KOD #0000000
90-
91-
q)
92-
93-
**N.B.** [build instructions for the image are available](docker/README.md)
94-
95-
#### Headless/Presets
96-
97-
If you are running this in a headless configuration, or wish to provide out-of-bound the answers to the license process, then you can call upon the following environment variables. This is handled either by [`--env` (or `--env-file`) as detailed on the docker website](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
98-
99-
* **`KDB_LICENSE_AGREE`:** pass in `yes` (case-insensitive) to agree to the license agreement
100-
* **`COMPANY` (optional):** provide company name
101-
* **`NAME`:** provide your name
102-
* **`EMAIL`:** provide your email address
103-
104-
If any of these are missing, then you will be prompted for the value as before.
105-
106-
**N.B.** alternatively you can use `QLIC_KC` (also supported is `QLIC_K4`) which is the base64 encoded contents of your `kc.lic` file
107-
108-
This allows for the following usage:
109-
110-
$ echo \\\\ | docker run -i -e QLIC_KC=$(cat $QHOME/kc.lic | base64 -w0) --name myembedpy embedpy q -q
111-
$ echo 'p)print(1+2)' | docker start -i myembedpy
112-
3
70+
**N.B.** Further options for running and build instructions for the image are available [here](docker/README.md)
11371

11472
## Usage
11573

docker/README.md

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,81 @@
1-
The instructions below are for building your own Docker image. A prebuilt Docker image is available on Docker Cloud, if you only want to run the embedPy image then install Docker and [read the main instructions](https://github.com/KxSystems/embedPy#docker) on how to do this.
1+
# Run
22

3-
# Preflight
3+
If you have [Docker installed](https://www.docker.com/community-edition) there is a prebuilt docker image you can run with:
4+
5+
$ docker run -it --name myembedpy kxsys/embedpy
6+
kdb+ on demand - Personal Edition
7+
8+
[snipped]
9+
10+
I agree to the terms of the license agreement for kdb+ on demand Personal Edition (N/y): y
11+
12+
If applicable please provide your company name (press enter for none): ACME Limited
13+
Please provide your name: Bob Smith
14+
Please provide your email (requires validation): [email protected]
15+
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
16+
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 [email protected] KOD #0000000
17+
18+
q)
19+
20+
For subsequent runs, you will not be prompted to redo the license setup when calling:
21+
22+
$ docker start -ai myembedpy
23+
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
24+
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 [email protected] KOD #0000000
25+
26+
q)
27+
28+
If you prefer to drop straight into `bash` you can with:
29+
30+
$ docker run -it kxsys/embedpy bash
31+
[snipped license setup]
32+
kx@8ac226623908:~$ conda info
33+
34+
active environment : kx
35+
active env location : /home/kx/.conda/envs/kx
36+
[snipped]
37+
kx@8ac226623908:~$ q
38+
KDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems
39+
l64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 [email protected] KOD #0000000
40+
41+
q)
42+
43+
**N.B.** [build instructions for the image are available](README.md#build)
44+
45+
## Headless/Presets
46+
47+
If you are running this in a headless configuration, or wish to provide out-of-bound the answers to the license process, then you can call upon the following environment variables. This is handled either by [`--env` (or `--env-file`) as detailed on the docker website](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file).
48+
49+
* **`KDB_LICENSE_AGREE`:** pass in `yes` (case-insensitive) to agree to the license agreement
50+
* **`COMPANY` (optional):** provide company name
51+
* **`NAME`:** provide your name
52+
* **`EMAIL`:** provide your email address
53+
54+
If any of these are missing, then you will be prompted for the value as before.
55+
56+
**N.B.** alternatively if you already have a licence you can use `QLIC_KC` (also supported is `QLIC_K4`) which is the base64 encoded contents of your `kc.lic` file
57+
58+
This allows for the following usage:
59+
60+
61+
$ echo \\\\ | docker run -i -e QLIC_KC=$(cat $QHOME/kc.lic | base64 -w0) --name myembedpywithlic kxsys/embedpy q -q
62+
$ echo 'p)print(1+2)' | docker start -i myembedpywithlic
63+
3
64+
65+
66+
# Build
67+
68+
The instructions below are for building your own Docker image. A prebuilt Docker image is available on Docker Cloud, if you only want to run the embedPy image then install Docker and [read the instructions above](README.md#run) on how to do this.
69+
70+
## Preflight
471

572
You will need [Docker installed](https://www.docker.com/community-edition) on your workstation; make sure it is a recent version.
673

774
Check out a copy of the project with:
875

976
git clone https://github.com/KxSystems/embedPy.git
1077

11-
# Build
78+
## Building
1279

1380
To build locally the project you run:
1481

@@ -20,7 +87,7 @@ Once built, you should have a local `embedpy` image, you can run the following t
2087

2188
# Deploy
2289

23-
[Google Cloud Builder](https://cloud.google.com/container-builder/docs/) is configured to monitor when tags of the format `/^[0-9.]+/` are added to the [GitHub hosted project](https://github.com/KxSystems/embedPy), a corresponding Docker image is generated and made available on [Docker Cloud](https://cloud.docker.com/)
90+
[travisCI](https://travis-ci.org/) is configured to monitor when tags of the format `/^[0-9]+\./` are added to the [GitHub hosted project](https://github.com/KxSystems/embedPy), a corresponding Docker image is generated and made available on [Docker Cloud](https://cloud.docker.com/)
2491

2592
This is all done server side as the resulting image is north of 350MB.
2693

@@ -30,7 +97,6 @@ To do a deploy, you simply tag and push your releases as usual:
3097
git tag 0.7
3198
git push --tag
3299

33-
## Travis Option
34100

35101
## Related Links
36102

docker/gcp-build.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)