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

Elektra Web - docker images #2100

Merged
merged 8 commits into from Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 21 additions & 3 deletions doc/news/_preparation_next_release.md
Expand Up @@ -39,7 +39,7 @@ You can also read the news [on our website](https://www.libelektra.org/news/0.8.

- Type system preview
- Chef Cookbook
- <<HIGHLIGHT3>>
- Elektra Web 1.5


### Type system preview
Expand Down Expand Up @@ -96,10 +96,28 @@ end

Thanks to Michael Zronek and Vanessa Kos.

### <<HIGHLIGHT2>>

### Elektra Web 1.5

The new release of Elektra Web features many UX improvements from the usability test!

[![Elektra Web 1.5 video](https://img.youtube.com/vi/lLg9sk6Hx-E/0.jpg)](https://www.youtube.com/watch?v=lLg9sk6Hx-E)

Try it out now on: http://webui.libelektra.org:33334/

- search completely reworked - it does not act as a filter on already opened keys anymore, and instead searches the whole key database - feedback from the search was also greatly improved (pulsating while searching, glowing blue when done)
- added "abort" buttons to dialogs to revert actions
- added "create array" button to easily create arrays
- removed confirmation dialog before deletion (undo can be used instead)
- created a docker image: `elektra/web`
- small fixes:
- updated visibility levels
- removed "done" button in main view
- fixed issues with the opener click area
- remove metakeys when they are set to the default value or empty/0
- improved keyboard support
- fixed many small issues (#2037)

### <<HIGHLIGHT2>>


## Plugins
Expand Down
9 changes: 9 additions & 0 deletions scripts/docker/web/README.md
@@ -0,0 +1,9 @@
# Elektra Web docker images

- `elektra/web-base` - base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`)
- `elektra/elektrad` - image that only starts elektrad
- `elektra/webd` - image that only starts webd
- `elektra/elektrad-demo` - same as `elektrad`, but with a KDB config set up (for demo, should run on http://elektrad-demo.libelektra.org)
- `elektra/webd-demo` - same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo, should run on http://webui.libelektra.org)
- `elektra/web` - image that starts elektrad & webd (for those who just want to try out Elektra Web locally, also mentioned in quickstart in README of #2099)

30 changes: 30 additions & 0 deletions scripts/docker/web/base/Dockerfile
@@ -0,0 +1,30 @@
# base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`)

FROM ubuntu:16.04

# elektra deps
RUN apt-get update -y
RUN apt-get install -y cmake git build-essential

# elektra web deps
RUN apt-get install -y libyajl-dev curl nodejs-legacy npm
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs

# pull latest libelektra
RUN mkdir /home/elektra
WORKDIR /home/elektra
ARG ELEKTRA_VER=master
RUN git clone -b ${ELEKTRA_VER} --depth 1 https://github.com/ElektraInitiative/libelektra.git
WORKDIR /home/elektra/libelektra

# build & install libelektra
RUN mkdir /home/elektra/libelektra/build
WORKDIR /home/elektra/libelektra/build
RUN cmake .. -DTOOLS="kdb;web"
RUN make
RUN make install

# prepare user and home dir
RUN groupadd -r elektra && useradd --no-log-init -r -g elektra elektra
RUN chown -R elektra:elektra /home/elektra
25 changes: 25 additions & 0 deletions scripts/docker/web/elektrad-demo/Dockerfile
@@ -0,0 +1,25 @@
# same as `elektrad`, but with a KDB config set up (for demo)

FROM elektra/web-base:latest

WORKDIR /home/elektra

# prepare demo environment

# mount copy of /etc/hosts to user/hosts

# mount as root user
RUN kdb mount --with-recommends hosts user/hosts hosts
Copy link
Contributor

Choose a reason for hiding this comment

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

will that work? shouldn't you be the elektra user when inheriting from your base image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, USER is not called in the base image


# then switch to elektra user
USER elektra
RUN mkdir /home/elektra/.config
RUN cp /etc/hosts /home/elektra/.config/hosts

# create user/app structure
COPY --chown=elektra:elektra demo.kdb /home/elektra/
RUN kdb import user/app < /home/elektra/demo.kdb

# run elektrad
EXPOSE 33333
CMD ["kdb","run-elektrad"]
Binary file added scripts/docker/web/elektrad-demo/demo.kdb
Binary file not shown.
10 changes: 10 additions & 0 deletions scripts/docker/web/elektrad/Dockerfile
@@ -0,0 +1,10 @@
# image that only starts elektrad

FROM elektra/web-base:latest

WORKDIR /home/elektra
USER elektra

# run elektrad
EXPOSE 33333
CMD ["kdb","run-elektrad"]
15 changes: 15 additions & 0 deletions scripts/docker/web/web/Dockerfile
@@ -0,0 +1,15 @@
# image that starts elektrad & webd (for quickstart with elektra web)

FROM elektra/web-base:latest

WORKDIR /home/elektra
USER elektra

# create start script
RUN printf "#!/bin/bash\nkdb run-elektrad &\nkdb run-web" > start
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought you will split this up into two containers?

Please give a description about the individual dockerfiles. (as comments and in the README.md)

Copy link
Contributor Author

@omnidan omnidan Jun 19, 2018

Choose a reason for hiding this comment

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

@markus2330 I explained this in the PR description, elektra/web contains both so that you can quickly test elektra web (quickstart guide in README)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the description to a README file

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! Please always keep all information within the repo (and not in the PR description).

RUN chmod +x start

# run elektrad and webd in one container
EXPOSE 33333
EXPOSE 33334
CMD ["/home/elektra/start"]
14 changes: 14 additions & 0 deletions scripts/docker/web/webd-demo/Dockerfile
@@ -0,0 +1,14 @@
# same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo)

FROM elektra/web-base:latest

WORKDIR /home/elektra
USER elektra

# prepare demo environment
COPY --chown=elektra:elektra demo.kdb /home/elektra/
RUN kdb import user/sw < /home/elektra/demo.kdb

# run webd (serves client)
EXPOSE 33334
CMD ["kdb","run-web"]
Binary file added scripts/docker/web/webd-demo/demo.kdb
Binary file not shown.
10 changes: 10 additions & 0 deletions scripts/docker/web/webd/Dockerfile
@@ -0,0 +1,10 @@
# image that only starts webd

FROM elektra/web-base:latest

WORKDIR /home/elektra
USER elektra

# run webd (serves client)
EXPOSE 33334
CMD ["kdb","run-web"]