1
0
Fork 0

agents now connect through swarm plugin

This commit is contained in:
Christian Kühnel 2019-10-14 18:03:21 +02:00
parent 3078056d6f
commit a88e8f2ce0
5 changed files with 34 additions and 81 deletions

View file

@ -4,9 +4,8 @@ RUN apt-get update ;\
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
cmake ninja-build git ca-certificates clang-8 lld-8 clang ccache python python3 build-essential \ cmake ninja-build git ca-certificates clang-8 lld-8 clang ccache python python3 build-essential \
clang-tidy-8 clang-format-8 \ clang-tidy-8 clang-format-8 \
python-psutil arcanist zip \ python-psutil arcanist zip wget \
openjdk-11-jdk \ openjdk-11-jdk ;\
openssh-server ;\
apt-get clean apt-get clean
# required for openssh server # required for openssh server
@ -34,6 +33,9 @@ RUN chown -R ${user}:${user} /home/${user} ;\
WORKDIR /home/${user} WORKDIR /home/${user}
ENV CCACHE_PATH=/mnt/disks/ssd0/ccache ENV CCACHE_PATH=/mnt/disks/ssd0/ccache
EXPOSE 22 RUN cd /scripts ;\
wget https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.17/swarm-client-3.17.jar ;\
mv swarm-client-3.17.jar swarm-client.jar
CMD ["/scripts/start_agent.sh"] CMD ["/scripts/start_agent.sh"]

View file

@ -27,4 +27,4 @@ chown -R jenkins:jenkins "${CCACHE_PATH}"
# TODO(kuhnel): wipe the disk(s) on startup # TODO(kuhnel): wipe the disk(s) on startup
# start ssh server # start ssh server
/usr/sbin/sshd -D java -jar /scripts/swarm-client.jar -master http://jenkins-ui.jenkins.svc.cluster.local:8080 -executors 1

View file

@ -1,38 +0,0 @@
FROM debian:testing
VOLUME ["/ccache"]
RUN apt-get update ;\
apt-get install -y --no-install-recommends \
cmake ninja-build git ca-certificates clang-8 lld-8 clang ccache python python3 build-essential \
clang-tidy-8 clang-format-8 \
python-psutil arcanist zip \
openjdk-11-jdk \
openssh-server ;\
apt-get clean
# required for openssh server
RUN mkdir -p /run/sshd
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG AGENT_WORKDIR=/home/${user}/agent
RUN groupadd -g ${gid} ${group} ;\
useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} ;\
mkdir /home/${user}/agent ; \
mkdir /home/${user}/ccache
COPY authorized_keys /home/${user}/.ssh/
RUN chown -R ${user}:${user} /home/${user} ;\
chmod 700 /home/${user}/.ssh
WORKDIR ${AGENT_WORKDIR}
ENV CC=clang-8
ENV CXX=clang++-8
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

View file

@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwYAn/XBFxk1uBhgYCuNLLpriM88dIa22nZdXjzdW7TjGMM2PbJQEPRvGRJjFkgxcRZgND6+oGD8ldMacI7TF5m+TF4TXEp7PKbjeP0vqWx1d/xn2QxDHItWNLXfV9F96TNCMIHjcV9iHZ9u4ciudw51NmsT7oVDsyy+lB9+/I7RbOTzCsDMQQcBdHTCXBqGSo7UtxkQ3qgsWPYDpQpBa8lSIUBhCnsG+hnjk1IHYu9XFqo5jzeUR4DzAuUqzZuxAb/dYWkPjpFlH8RSPpvxRGl3xXeH0VQ9yrlm8zqfTCmXSv14zRpGTrfQFrXXnJTKcQ4+5ACeXOnTKiiWhjlYT3 user@machine

View file

@ -15,9 +15,9 @@
--- ---
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: jenkins name: jenkins
labels: labels:
name: jenkins name: jenkins
--- ---
apiVersion: v1 apiVersion: v1
@ -117,16 +117,6 @@ spec:
port: 8080 port: 8080
targetPort: 8080 targetPort: 8080
name: ui name: ui
---
kind: Service
apiVersion: v1
metadata:
name: jenkins-discovery
namespace: jenkins
spec:
selector:
app: master
ports:
- protocol: TCP - protocol: TCP
port: 50000 port: 50000
targetPort: 50000 targetPort: 50000
@ -156,7 +146,7 @@ spec:
storageClassName: "" storageClassName: ""
resources: resources:
requests: requests:
storage: 10Gi storage: 10Gi
--- ---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
@ -171,31 +161,31 @@ spec:
app: agent-debian-testing-clang8-ssd app: agent-debian-testing-clang8-ssd
spec: spec:
containers: containers:
- name: agent-debian-testing-clang8 - name: agent-debian-testing-clang8
image: gcr.io/llvm-windows-development/agent-debian-testing-clang8-ssd image: gcr.io/llvm-windows-development/agent-debian-testing-clang8-ssd
ports: ports:
- containerPort: 22 - containerPort: 22
resources: resources:
limits: limits:
cpu: 15 cpu: 15
memory: 45Gi memory: 45Gi
requests: requests:
cpu: 15 cpu: 15
memory: 45Gi memory: 45Gi
volumeMounts: volumeMounts:
- name: nfs-pvc
mountPath: /mnt/nfs
- name: ssd
mountPath: /mnt/disks/ssd0
volumes:
- name: nfs-pvc - name: nfs-pvc
persistentVolumeClaim: mountPath: /mnt/nfs
claimName: nfs-jenkins - name: ssd
- name: ssd mountPath: /mnt/disks/ssd0
hostPath: volumes:
# directory location on host - name: nfs-pvc
path: /mnt/disks/ssd0 persistentVolumeClaim:
type: Directory claimName: nfs-jenkins
- name: ssd
hostPath:
# directory location on host
path: /mnt/disks/ssd0
type: Directory
nodeSelector: nodeSelector:
cloud.google.com/gke-nodepool: jenkins-agents cloud.google.com/gke-nodepool: jenkins-agents
--- ---