|
1 |
| -This project builds the Docker image. |
| 1 | +# Run |
2 | 2 |
|
3 |
| -## Related Links |
| 3 | +If you have [Docker installed](https://www.docker.com/community-edition) there is a prebuilt docker image you can run with: |
4 | 4 |
|
5 |
| - * [Docker](https://docker.com) |
6 |
| - * [`Dockerfile`](https://docs.docker.com/engine/reference/builder/) |
7 |
| - * [Automated Builds](https://docs.docker.com/docker-cloud/builds/automated-build/) |
8 |
| - * [Advanced options for Autobuild and Autotest](https://docs.docker.com/docker-cloud/builds/advanced/) |
| 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) |
9 | 19 |
|
10 |
| -# Preflight |
| 20 | +For subsequent runs, you will not be prompted to redo the license setup when calling: |
11 | 21 |
|
12 |
| -You will need [Docker installed](https://www.docker.com/community-edition) on your workstation; make sure it is a recent version as they are always breaking backwards compatibility. |
| 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) |
13 | 27 |
|
14 |
| -Check out a copy of the project with: |
| 28 | +If you prefer to drop straight into `bash` you can with: |
15 | 29 |
|
16 |
| - git clone https://github.com/KxSystems/embedPy.git |
| 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) |
17 | 42 |
|
18 |
| -# Deploy |
| 43 | +**N.B.** [build instructions for the image are available](README.md#build) |
19 | 44 |
|
20 |
| -[Docker Cloud](https://cloud.docker.com/) 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 file is generated and made available. |
| 45 | +## Headless/Presets |
21 | 46 |
|
22 |
| -This is all done server side as the resulting image is north of 350MB and uploading that sort of thing is likely to prompt the network team to Release the Kraken! |
| 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). |
23 | 48 |
|
24 |
| -To do a deploy, you simply tag and push your releases as usual: |
| 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 |
25 | 53 |
|
26 |
| - git push |
27 |
| - git tag 0.7 |
28 |
| - git push --tag |
| 54 | +If any of these are missing, then you will be prompted for the value as before. |
29 | 55 |
|
30 |
| -## First Time Configuration |
| 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 |
31 | 57 |
|
32 |
| - 1. Log into [Docker Cloud](https://cloud.docker.com/) |
33 |
| - 1. Create the new repository called `embedpy` |
34 |
| - 1. Go to the 'Builds' tab |
35 |
| - 1. Set the 'Source Repository' to the GitHub account 'KxSystems' and project `embedPy` |
36 |
| - 1. Set the 'Build Rules' to: |
37 |
| - * **Source Type:** Tag |
38 |
| - * **Source:** `/^[0-9.]+/` |
39 |
| - * **Docker Tag:** `{sourceref}` |
40 |
| - * **Dockerfile location:** `docker/Dockerfile` |
41 |
| - * **Build Context:** `/` |
42 |
| - * **Autobuild:** enabled |
43 |
| - * **Build Caching:** disabled (Docker Cloud is *really* buggy, `nocache=1` as a build env may help) |
44 |
| - 1. Click on the 'Save' button |
| 58 | +This allows for the following usage: |
45 | 59 |
|
46 |
| -If you prefer to not have Docker Cloud build on every tag push, you can alternatively: |
47 | 60 |
|
48 |
| - 1. Under 'Build Rules' disable 'Autobuild' |
49 |
| - 1. Click on 'Save' |
50 |
| - 1. At the bottom of the configuration page under 'Build triggers', create a URL that you can use to fire off a build |
| 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 |
51 | 64 |
|
52 |
| -You should now be able to call `curl` on the supplied URL to trigger the build, sparing you from having to log in to click a button. |
53 | 65 |
|
54 | 66 | # Build
|
55 | 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 |
| 71 | + |
| 72 | +You will need [Docker installed](https://www.docker.com/community-edition) on your workstation; make sure it is a recent version. |
| 73 | + |
| 74 | +Check out a copy of the project with: |
| 75 | + |
| 76 | + git clone https://github.com/KxSystems/embedPy.git |
| 77 | + |
| 78 | +## Building |
| 79 | + |
56 | 80 | To build locally the project you run:
|
57 | 81 |
|
58 | 82 | docker build -t embedpy -f docker/Dockerfile .
|
59 | 83 |
|
60 |
| -Other build arguments are supported and you should browse the `Dockerfile` to see what they are, but note for Docker Cloud you will need to make sure they are also explicitly exported in [`docker/hooks/build`](hooks/build) too. |
| 84 | +Once built, you should have a local `embedpy` image, you can run the following to use it: |
| 85 | + |
| 86 | + docker run -it embedpy |
| 87 | + |
| 88 | +# Deploy |
| 89 | + |
| 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/) |
| 91 | + |
| 92 | +This is all done server side as the resulting image is north of 350MB. |
| 93 | + |
| 94 | +To do a deploy, you simply tag and push your releases as usual: |
| 95 | + |
| 96 | + git push |
| 97 | + git tag 0.7 |
| 98 | + git push --tag |
| 99 | + |
61 | 100 |
|
62 |
| -Once built, you should have a local `embedpy` image you can run the following to use it: |
| 101 | +## Related Links |
63 | 102 |
|
64 |
| - docker run -it -v `pwd`/q:/tmp/q embedpy |
| 103 | + * [Docker](https://docker.com) |
| 104 | + * [`Dockerfile`](https://docs.docker.com/engine/reference/builder/) |
0 commit comments