Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes at CERN: Use Cases, Integration and ...

Kubernetes at CERN: Use Cases, Integration and Challenges

Ricardo Rocha

January 31, 2019
Tweet

More Decks by Ricardo Rocha

Other Decks in Technology

Transcript

  1. 7

  2. 8

  3. Simplified Infrastructure Monitoring, Lifecycle, Alarms Simplified Deployment Uniform API, Replication,

    Load Balancing Periodic Load Spikes International Conferences, Reprocessing Campaigns
  4. 1 PB / sec < 10 GB / sec Typically

    split into Hardware and Software Filters ( this might change too ) 40 million particle interactions / second ~3000 multi-core nodes ~30.000 applications to supervise Critical system, sustained failure means data loss Can it be improved for Run 4? Study 2017, Mattia Cadeddu, Giuseppe Avolio Kubernetes 1.5.x A new evaluation phase to be tried this year ATLAS Event Filter
  5. First results… 100 node cluster 40 sec to start 500

    applications on 100 nodes Container launch rate 12Hz Not particularly promising ... Issues Found QPS defaults were very conservative Tested x1, x2, x3, x4 values QPS x4 gives 57Hz: > 330 % improvement Does Kubernetes prefer larger clusters ?
  6. How to efficiently distribute experiment software? CernVM-FS (cvmfs): a read-only,

    hierarchical filesystem In production for several years, battle tested, solved problem Now with containers? Can they carry all required software? > 200 sites in our computing grid ~400 000 concurrent jobs Frequent software releases 100s of GBs
  7. Docker Images of ~10GB+ Poorly Layered, Frequently Updated Clusters of

    100s of nodes Can we have file level granularity? And caches? CERN EP-SFT Jakob Blomer, Nikola Hardi Simone Mosciatti Docker Graph Driver
  8. What about multiple container runtimes? containerd, cri-o, kata containers, …

    Where do we plug this logic? Proposal: unpacked layer support in containerd https://github.com/containerd/containerd/issues/2943 ( IBM, Google, Docker, Alibaba, ... )
  9. Simulation is one of our major computing workloads x100 soon

    as described early Deep Learning for Fast Simulation Can we easily distribute to reduce training time? Sofia Vallecorsa, CERN OpenLab Konstantinos Samaras-Tsakiris
  10. $ # Master + workers $ docker run --network=host -P

    \ -e PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ -e LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64" \ -e LIBRARY_PATH="/usr/local/cuda/lib64/stubs" \ -e CUDA_VERSION="9.0.176" -e CUDA_PKG_VERSION="9-0=9.0.176-1" \ -e NVIDIA_VISIBLE_DEVICES="all" -e NVIDIA_DRIVER_CAPABILITIES="compute,utility" \ -e NVIDIA_REQUIRE_CUDA="cuda>=9.0" \ -v "/usr/local/nvidia:/usr/local/nvidia:ro" \ --device "/dev/nvidia0" --device "/dev/nvidiactl" \ --device "/dev/nvidia-uvm" \ kosamara/ecal/svalleco \ "./master.sh" "2" $ docker run ... \ gitlab-registry.cern.ch/kosamara/ecal/svalleco \ "./worker.sh" Round 1: Docker only + MPI hostfile (hardcoded IPs) + SSH keys + Rebuild for every code change Per VM...
  11. apiVersion: batch/v1 kind: Job ... image: kosamara/ecal/svalleco command: ["./master.sh", “

    ${num_replicas}”] resources: limits: nvidia.com/gpu: 1 ... apiVersion: apps/v1 kind: Deployment ... replicas: ${num_replicas} ... image: kosamara/ecal/svalleco command: ["./worker.sh"] resources: limits: nvidia.com/gpu: 1 ... Round 2: Kubernetes + MPI hostfile (hardcoded IPs) + SSH keys + Rebuild for every code change master worker
  12. Round 3: Kubeflow $ cat train-mpi_3dGAN.yaml apiVersion: kubeflow.org/v1alpha1 kind: MPIJob

    metadata: name: train-mpijob spec: backoffLimit: 6 replicas: ${num_replicas} template: spec: hostNetwork: true containers: - image: kosamara/ecal/ mpijob name: train-mpijob resources: limits: nvidia.com/gpu: 1 command: - bash - -c - > mpirun -tag-output -x LD_LIBRARY_PATH -x PATH python3 MPIGDriver.py train.ls test.ls --tf --epochs 16 --easgd --worker-opt rmsprop volumeMounts: - mountPath: /model name: model-data volumes: - name: model-data persistentVolumeClaim: claimName: model-pvc no master/worker just replicas + MPI hostfile (hardcoded IPs) + SSH keys + Rebuild for every code change
  13. ATLAS Production System Running a Grid site is not trivial

    We have > 200 of them Multiple components for Storage and Compute Lots of history in the software Fernando Barreiro Megino Fahui-Lin, Mandy Yang ATLAS Distributed Computing Can a Kubernetes endpoint be a Grid site?
  14. 1st attempt to ramp up. K8s master running on Medium

    VM Master killed (OOM) on Saturday Test Cluster with 2000 cores Good: Initial results show error rates as any other site Improvements: defaults on the scheduler causing inefficiencies Pack vs Spread Affinity Predicates, Weights Custom Scheduler?
  15. SIG Multi-Cluster Federation v2 Replica Scheduling, Cluster Weights, Placement Policies

    apiVersion: scheduling.federation.k8s.io/v1alpha1 kind: ReplicaSchedulingPreference metadata: name: jupyterhub namespace: hub spec: targetKind: FederatedDeployment totalReplicas: 9 clusters: CERN: minReplicas: 2 maxReplicas: 6 weight: 100 Exoscale: minReplicas: 0 maxReplicas: 3 weight: 20 “ Fill up CERN before using Cloud X “ “ Prefer Cloud X for GPU workloads “ “ Send TPU workloads to Google Cloud “
  16. New Theory 1 New Theory 2 New Theory 3 Calculating

    how new particles would show up in LHC data RECAST: preserve computation with containers Reuse often to test many candidate theories Lukas Heinrich, CERN & NYU REANA, Tibor Simko & Diego Rodriguez
  17. Common use for infrastructure data analysis Spark Operator brings feature

    parity with YARN Production next week Prasant Kothuri Piotr Mrowczynski CERN DB Team
  18. Kubernetes as a Service Build on top of what’s there,

    integrate where needed Virtual Machines, Baremetal, GPUs, ... Storage Identity Monitoring Compute openstack coe cluster create --cluster-template kubernetes --node-count 100 mycluster
  19. First container storage integration done using docker volume drivers +

    Flex Volume integration for Kubernetes Second round we jumped on the Container Storage Interface (CSI) 0.1 0.2 “ From a train wreck… https://github.com/ceph/ceph-csi
  20. First container storage integration done using docker volume drivers +

    Flex Volume integration for Kubernetes Second round we jumped on the Container Storage Interface (CSI) 0.1 0.2 0.3 1.0 “ From a train wreck… to a train ride “ Robert Vasek https://github.com/ceph/ceph-csi Production
  21. Behind in networking We currently have a flat, provider network

    Hard to evolve, risk of losing physics data Parts of Kubernetes expect more flexibility than we currently offer “ Seems Type: LoadBalancer is not working in my cluster “ “ Can i get multi master clusters? “
  22. Catching up quickly in Auto Scaling Already possible to ‘fill

    holes’ in any cluster with compute workloads Boinc LHC@Home Simulation Workloads Cluster Auto Scaler by default in a couple weeks Cluster Healing will come as a bonus
  23. Working on Dissemination “ Containers are great, i even wrote

    my own orchestrator “ “ Tried it, but it couldn’t do X so i gave up “ Hands-on Training Sessions Container Office Hours, every 3rd Friday of the month