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

Dockerize PenguinDome and update the wipe script #31

Open
hady44 opened this issue Jun 8, 2021 · 5 comments
Open

Dockerize PenguinDome and update the wipe script #31

hady44 opened this issue Jun 8, 2021 · 5 comments

Comments

@hady44
Copy link

hady44 commented Jun 8, 2021

I had to dockerize penguinDome and deploy it on our kubernetes cluster and would like to push the DockerFile to make it easier for anyone who wants to do the same in the future.

I also updated the wipe.sh to use shred also I changed the order of operations to avoid potentially having dummy files.

I also have the helm chart, which I would need to change a bit, but I should be able to push in the future as well.

@hady44 hady44 changed the title Dockerize PenguinDome Dockerize PenguinDome and update the wipe scrip Jun 8, 2021
@hady44
Copy link
Author

hady44 commented Jun 8, 2021

The DockerFile

FROM ubuntu:18.04

WORKDIR /usr/src/app

COPY . .

USER 0

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git

RUN apt-get install --yes systemd curl git sudo

# Kill all the things we don't need
RUN find /etc/systemd/system \
    /lib/systemd/system \
    -path '*.wants/*' \
    -not -name '*journald*' \
    -not -name '*systemd-tmpfiles*' \
    -not -name '*systemd-user-sessions*' \
    -exec rm \{} \;

RUN mkdir -p /etc/sudoers.d

RUN systemctl set-default multi-user.target

RUN alias python=python3

RUN apt-get install dialog apt-utils -y

RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata

RUN ./server/server-setup.sh -y
COPY ./server/settings.yml  ./server/settings.yml
COPY ./client/settings.yml  ./client/settings.yml

EXPOSE 80
EXPOSE 5000

CMD [ "python", "server/server.py" ]

@hady44
Copy link
Author

hady44 commented Jun 8, 2021

The updated wipe.sh

#!/bin/bash

# Quantopian, Inc. licenses this file to you 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.

# Danger Will Robinson!
#dryrun=echo

while read username homedir; do
    while read pid; do
        $dryrun kill -9 $pid
    $dryrun shred -f $homedir &
    done < <(ps -o pid= -U $username)
    $dryrun userdel --force $username &
done < <(awk -F: '$3 >= 1000 {print $1, $6}' /etc/passwd)

wait

@hady44 hady44 changed the title Dockerize PenguinDome and update the wipe scrip Dockerize PenguinDome and update the wipe script Jun 8, 2021
@squalou
Copy link

squalou commented Sep 24, 2024

Hi,

this issue is 3 years old, sorry to sort-of necrobump it but I would require a Docker build too. At the moment the proposed Dockerfile in PR does not work, and it doesn't seem trivial to make install script work.

Any hope for help doing this ? Said differently : any idea of what may prevent success before I spend days trying the impossible ?

Thank you for any advice !

@jikamens
Copy link
Collaborator

I don't see any reason why the PD server would be particularly difficult to Dockerize. I haven't done it because (a) I am not actively using PenguinDome right now and (b) I'm an old fogey who has thus far avoided having to deal with Docker in any substantial way and would rather not start now. ;-)

I'm happy to accept a PR.

@squalou
Copy link

squalou commented Sep 24, 2024

Great !
Will continue the effort, in fact simply using --skip-systemctl and start server with another mean should do the trick. I'll let you know if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants