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

DEVOPS-1037 Update Condor Base Image and DeDockerize #31

Draft
wants to merge 72 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
17ab79d
Create pre-exec.sh
bio-boris Oct 31, 2022
e44811f
Update Dockerfile
bio-boris Oct 31, 2022
e059475
Create manual-build.yml
bio-boris Oct 31, 2022
ab7d1f3
Update pre-exec.sh
bio-boris Oct 31, 2022
1aaf967
Update README.md
bio-boris Nov 2, 2022
f0dd74b
Update README.md
bio-boris Nov 2, 2022
53a1113
Update pre-exec.sh
bio-boris Nov 2, 2022
10cc323
Update pre-exec.sh
bio-boris Nov 2, 2022
fe4148a
Delete start-condor.sh
bio-boris Nov 2, 2022
f7502f5
Delete condor_config
bio-boris Nov 2, 2022
d69a959
Delete condor_ssh_to_job_sshd_config_template
bio-boris Nov 2, 2022
b837f80
Update condor_config.local.templ
bio-boris Nov 2, 2022
3cc6169
Update pre-exec.sh
bio-boris Nov 2, 2022
dc3795f
Delete build
bio-boris Nov 2, 2022
5f7ad37
Delete shared_port.config
bio-boris Nov 2, 2022
8ce4126
Delete condor_config.docker_image
bio-boris Nov 2, 2022
52c65f7
Update and rename deployment/conf/.templates/condor_config.local.temp…
bio-boris Nov 2, 2022
5419552
Update Dockerfile
bio-boris Nov 2, 2022
40edb63
Rename deployment/bin/pre-exec.sh to pre-exec.sh
bio-boris Nov 4, 2022
be0da48
Update and rename deployment/conf/condor_config.local to kbase_condor…
bio-boris Nov 4, 2022
3c6b33a
Update pre-exec.sh
bio-boris Nov 4, 2022
fe74413
Rename kbase_condor_defaults.config to kbase_config.conf
bio-boris Nov 4, 2022
8bec267
Update Dockerfile
bio-boris Nov 4, 2022
f8859c5
Update pre-exec.sh
bio-boris Nov 4, 2022
8893fa0
Update pre-exec.sh
bio-boris Nov 4, 2022
ba089da
Update pre-exec.sh
bio-boris Nov 14, 2022
91aa571
Updated Configs
bio-boris Nov 14, 2022
68008b1
Update Dockerfile
bio-boris Nov 14, 2022
72ea862
Update kbase_central_manager.conf
bio-boris Nov 14, 2022
40a477d
Update Dockerfile
bio-boris Nov 14, 2022
95fff1c
Update pre-exec.sh
bio-boris Nov 14, 2022
3bb1f3b
Update Dockerfile
bio-boris Nov 14, 2022
232214f
Update generate_ids.sh
bio-boris Nov 14, 2022
9c4589c
Update pre-exec.sh
bio-boris Nov 14, 2022
d4c6c86
Delete kbase_worker.conf
bio-boris Nov 14, 2022
55efe0d
Update pre-exec.sh
bio-boris Nov 14, 2022
d28ebd0
Update pre-exec.sh
bio-boris Nov 14, 2022
c1ad040
Update Dockerfile
bio-boris Dec 2, 2022
d4bccbc
Update kbase_central_manager.conf
bio-boris Dec 9, 2022
d2513c5
Update kbase_central_manager.conf
bio-boris Dec 9, 2022
4f73903
Update pre-exec.sh
bio-boris Dec 9, 2022
94187ab
Update pre-exec.sh
bio-boris Dec 9, 2022
8ea3efb
Update pre-exec.sh
bio-boris Dec 9, 2022
fb84e31
Create postStart.sh
bio-boris Dec 9, 2022
9125a5b
Update postStart.sh
bio-boris Dec 9, 2022
ed89315
Update pre-exec.sh
bio-boris Dec 9, 2022
e5cc148
Update pre-exec.sh
bio-boris Dec 9, 2022
9ab0313
Update Dockerfile
bio-boris Dec 9, 2022
6bfc66b
Update pre-exec.sh
bio-boris Dec 9, 2022
25dc835
Update and rename postStart.sh to health_check.sh
bio-boris Dec 9, 2022
6ab4f72
Update Dockerfile
bio-boris Dec 9, 2022
f4c066f
Update pre-exec.sh
bio-boris Dec 9, 2022
a9f2e0c
Update kbase_central_manager.conf
bio-boris Dec 9, 2022
dcd5867
Update kbase_central_manager.conf
bio-boris Dec 9, 2022
24eba9c
Update pre-exec.sh
bio-boris Dec 20, 2022
9a2a2bd
Update generate_ids.sh
bio-boris Jan 13, 2023
d22e0e1
Update generate_ids.sh
bio-boris Jan 13, 2023
6de7fc0
Update kbase_central_manager.conf
bio-boris Jan 30, 2023
805d741
Update pre-exec.sh
bio-boris Feb 7, 2023
c59e5d5
Ensure permissions are correct
Feb 7, 2023
d3eebe1
Ensure permissions are correct
Feb 7, 2023
f1288ab
kbase_central_manager.conf
Feb 7, 2023
d329062
redoing what was done
Feb 7, 2023
dd8c25e
perms
Feb 7, 2023
fc86bb3
Fixup creation
Feb 7, 2023
7bec145
Fixup creation
Feb 7, 2023
6f9ffc1
Fixup creation
Feb 7, 2023
fd7065a
Fixup creation
Feb 7, 2023
28a61df
Updates
Feb 15, 2023
b994bd7
Update pre-exec.sh
bio-boris Feb 17, 2023
0a38361
Update pre-exec.sh
bio-boris Feb 17, 2023
d32b4ab
Update README.md
bio-boris Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Manual Build & Push
on:
workflow_dispatch:
jobs:
build-push:
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: br-${{ github.ref_name }}
secrets: inherit
46 changes: 6 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,7 @@
FROM htcondor/cm:9.11-el7
FROM htcondor/cm:9.12.0-el7
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New base image, removing extra stuff from dockerfile

RUN useradd -m condor_pool && usermod -a -G condor condor_pool

# These ARGs values are passed in via the docker build command
ARG BUILD_DATE
ARG VCS_REF
ARG BRANCH=develop


# Get commonly used utilities
RUN yum -y install deltarpm
RUN yum -y update && yum upgrade -y
RUN yum -y install epel-release wget which git deltarpm gcc libcgroup libcgroup-tools stress-ng

# Install DOCKERIZE
RUN curl -o /tmp/dockerize.tgz https://raw.githubusercontent.com/kbase/dockerize/dist/dockerize-linux-amd64-v0.5.0.tar.gz && \
cd /usr/bin && \
tar xvzf /tmp/dockerize.tgz && \
rm /tmp/dockerize.tgz

#ADD DIRS
RUN mkdir -p /var/run/condor && mkdir -p /var/log/condor && mkdir -p /var/lock/condor && mkdir -p /var/lib/condor/execute
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Old line for creating dirs


COPY deployment/conf /etc/condor/
COPY deployment/bin/start-condor.sh /usr/sbin/start-condor.sh
RUN adduser condor_pool
RUN mkdir -p /usr/local/condor/run/condor /usr/local/condor/log/condor /usr/local/condor/lock/condor /usr/local/condor/lib/condor/spool /usr/local/condor/lib/condor/execute


# The BUILD_DATE value seem to bust the docker cache when the timestamp changes, move to
# the end
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/kbase/condor.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0-rc1" \
us.kbase.vcs-branch=$BRANCH \
maintainer="Steve Chan sychan@lbl.gov"

ENTRYPOINT [ "/usr/bin/dockerize" ]
CMD [ "-template", "/etc/condor/.templates/condor_config.local.templ:/etc/condor/condor_config.local", \
"-stdout", "/var/log/condor/SchedLog", \
"/usr/sbin/start-condor.sh" ]
COPY pre-exec.sh /root/config/pre-exec.sh
COPY health_check.sh /health_check.sh
# See https://www-auth.cs.wisc.edu/lists/htcondor-users/2014-August/msg00044.shtml
COPY kbase_central_manager.conf /etc/condor/condor_config.local
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# condor
# Condor Central Manager and Schedd

KBase specific Condor scheduler image.
KBase specific condor scheduler image.
Based on the htcondor/cm:9.X images

## Supported ENV Variables
## New behavior
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ugh, looks like I forgot to update this with the variables from pre-exec.sh. Will have to do that next

* Copy credentials from environment into correct place as per the [docs](https://github.com/htcondor/htcondor/tree/main/build/docker/services#providing-additional-configuration)
* Enabled the `SCHEDD` to run in the same container as the `COLLECTOR`

# Supported ENV Variables used by [pre-exec.sh](deployment/bin/pre-exec.sh)


- `CONDOR_CONFIG_FILEPATH` - A path to a configfile to be copied into /etc/condor/condor_config.local
- `POOL_PASSWORD` - The password for the condor pool (to be deprecated by token)
- `JWT_TOKEN` - CM Token created by `condor_token_create -identity condor-central-manager`
- `SCHEDD_HOST` - If Present, then `SCHEDD` added to `DAEMON_LIST`


# ENV Vars used by [start.sh](https://github.com/htcondor/htcondor/blob/fa22cbcdc2c66c63d1f5a78a45606125aa44e165/build/docker/services-rhel/base/start.sh)

* `CONDOR_SERVICE_HOST` "${CONDOR_SERVICE_HOST:-${CONDOR_HOST:-\$(FULL_HOSTNAME)}}"
* `CONDOR_HOST` "${CONDOR_SERVICE_HOST:-${CONDOR_HOST:-\$(FULL_HOSTNAME)}}"
* `NUM_CPU` "${NUM_CPUS:-1}" \
* `MEMORY` "${MEMORY:-1024}" \
* `RESERVED_DISK` "${RESERVED_DISK:-1024}" \
* `USE_POOL_PASSWORD` "${USE_POOL_PASSWORD:-no}"

- CONDOR_CONFIG_FILEPATH - A path to a configfile to be copied into /etc/condor/condor_config.local
- POOL_PASSWORD - The password for the condor pool (to be deprecated by token)
13 changes: 0 additions & 13 deletions deployment/bin/start-condor.sh

This file was deleted.

84 changes: 0 additions & 84 deletions deployment/conf/.templates/condor_config.local.templ

This file was deleted.

84 changes: 0 additions & 84 deletions deployment/conf/condor_config

This file was deleted.

24 changes: 0 additions & 24 deletions deployment/conf/condor_ssh_to_job_sshd_config_template

This file was deleted.

30 changes: 0 additions & 30 deletions deployment/conf/config.d/condor_config.docker_image

This file was deleted.

4 changes: 0 additions & 4 deletions deployment/conf/config.d/shared_port.config

This file was deleted.

11 changes: 11 additions & 0 deletions generate_ids.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe this should be documented somewhere? This will need to be run on each environment we deploy

# Example of how to generate ids using the autogenerated signing key
UID_DOMAIN=condor.staging.kbase.us
condor_token_create -identity kbase_workers@${UID_DOMAIN} -token kbase_workers
condor_token_create -identity nersc_workers@${UID_DOMAIN} -token nersc_workers
condor_token_create -identity rest_api@${UID_DOMAIN} -token rest_api
condor_token_create -identity condor_stats@${UID_DOMAIN} -token condor_stats

#Used in EE2 Submit
condor_token_create -identity condor_pool@${UID_DOMAIN} -token condor_pool

5 changes: 5 additions & 0 deletions health_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could delete this since its currently unused

# This can be run by postStart to see if required variables have been set

: "${UID_DOMAIN:?Variable not set or empty}"
: "${CONDOR_JWT_TOKEN:?Variable not set or empty}"
16 changes: 0 additions & 16 deletions hooks/build

This file was deleted.

Loading