bitnamicharts/pytorch

Verified Publisher

By VMware

Updated 4 days ago

Bitnami Helm chart for PyTorch

Helm
Image
Artifact
Languages & frameworks
Machine learning & AI
Data science
0

500K+

bitnamicharts/pytorch repository overview

Bitnami Secure Images Helm chart for PyTorch

PyTorch is a deep learning platform that accelerates the transition from research prototyping to production deployment. Bitnami image includes Torchvision for specific computer vision support.

Overview of PyTorch

Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/pytorch

Note: You need to substitute the placeholders REGISTRY_NAME and REPOSITORY_NAME with a reference to your Helm chart registry and repository.

Introduction

This chart bootstraps a PyTorch deployment on a Kubernetes cluster using the Helm package manager.

Python is built for full integration into Python that enables you to use it with its libraries and main packages.

Before you begin

  • Kubernetes 1.23+
  • Helm 3.8.0+
  • PV provisioner support in the underlying infrastructure
  • ReadWriteMany volumes for deployment scaling

Installing the chart

To install the chart with the release name my-release:

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/pytorch

Note You need to substitute the placeholders REGISTRY_NAME and REPOSITORY_NAME with a reference to your Helm chart registry and repository. For example, in the case of Bitnami, you need to use REGISTRY_NAME=registry-1.docker.io and REPOSITORY_NAME=bitnamicharts.

These commands deploy PyTorch on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured.

Note List all releases using helm list.

Configuration and installation details

This section describes resource settings, rolling tags, loading files, pod affinity, backup, and other options.

Resource requests and limits

Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.

To make this process easier, the chart contains the resourcesPreset values, which automatically sets the resources section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.

Rolling VS Immutable tags

It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

Loading your files

The PyTorch chart supports three different ways to load your files. In order of priority, they are:

  1. Existing config map
  2. Files under the files directory
  3. Cloning a git repository

This means that if you specify a config map with your files, it won't look for the files/ directory nor the git repository.

In order to use use an existing config map, set the configMap=my-config-map parameter.

To load your files from the files/ directory you don't have to set any option. Just copy your files inside and don't specify a ConfigMap.

Finally, if you want to clone a git repository you can use those parameters:

cloneFilesFromGit.enabled=true
cloneFilesFromGit.repository=https://github.com/my-user/my-repo
cloneFilesFromGit.revision=master
Set pod affinity

This chart allows you to set your custom affinity using the affinity parameter. Find more information about pod affinity in the Kubernetes documentation.

As an alternative, you can use the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the podAffinityPreset, podAntiAffinityPreset, or nodeAffinityPreset parameters.

Backup and restore

To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using Velero, a Kubernetes backup/restore tool. Find the instructions for using Velero in this guide.

FIPS parameters

The FIPS parameters only have effect if you are using images from the Bitnami Secure Images catalog.

For more information on this new support, please refer to the FIPS Compliance section.

Persistence

The Bitnami PyTorch image can persist data. If enabled, the persisted path is /bitnami/pytorch by default.

The chart mounts a Persistent Volume at this location. The volume is created using dynamic volume provisioning.

Adjust permissions of persistent volume mountpoint

As the image run as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it.

By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions. As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination.

You can enable this initContainer by setting volumePermissions.enabled to true.

Parameters

The following subsections list global, common, and component-specific parameters.

Global parameters
NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.defaultStorageClassGlobal default StorageClass for Persistent Volume(s)""
global.storageClassDEPRECATED: use global.defaultStorageClass instead""
global.defaultFipsDefault value for the FIPS configuration (allowed values: '', restricted, relaxed, off). Can be overridden by the 'fips' objectrestricted
global.security.allowInsecureImagesAllows skipping image verificationfalse
global.compatibility.openshift.adaptSecurityContextAdapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation)auto
Common parameters
NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
fullnameOverrideString to fully override common.names.fullname template""
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]
PyTorch parameters
NameDescriptionValue
image.registryPyTorch image registryREGISTRY_NAME
image.repositoryPyTorch image repositoryREPOSITORY_NAME/pytorch
image.digestPyTorch image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
image.pullPolicyPyTorch image pull policyIfNotPresent
image.pullSecretsSpecify docker-registry secret names as an array[]
worldSizeNumber of nodes that will run the code1
containerPorts.pytorchPyTorch master port. MASTER_PORT will be set to this value49875
livenessProbe.enabledEnable livenessProbetrue
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe5
livenessProbe.periodSecondsPeriod seconds for livenessProbe60
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe45
livenessProbe.failureThresholdFailure threshold for livenessProbe5
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbetrue
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe5
readinessProbe.periodSecondsPeriod seconds for readinessProbe5
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe40
readinessProbe.failureThresholdFailure threshold for readinessProbe5
readinessProbe.successThresholdSuccess threshold for readinessProbe1
startupProbe.enabledEnable startupProbetrue
startupProbe.initialDelaySecondsInitial delay seconds for startupProbe5
startupProbe.periodSecondsPeriod seconds for startupProbe5
startupProbe.timeoutSecondsTimeout seconds for startupProbe20
startupProbe.failureThresholdFailure threshold for startupProbe5
startupProbe.successThresholdSuccess threshold for startupProbe1
customLivenessProbeCustom livenessProbe that overrides the default one{}
customReadinessProbeCustom readinessProbe that overrides the default one{}
customStartupProbeCustom startupProbe that overrides the default one{}
podSecurityContext.enabledEnabled Pytorch pods' Security Contexttrue
podSecurityContext.fsGroupChangePolicySet filesystem group change policyAlways
podSecurityContext.sysctlsSet kernel settings using the sysctl interface[]
podSecurityContext.supplementalGroupsSet filesystem extra groups[]
podSecurityContext.fsGroupSet Pytorch pods' Security Context fsGroup1001
containerSecurityContext.enabledEnabled containers' Security Contexttrue
containerSecurityContext.seLinuxOptionsSet SELinux options in container{}
containerSecurityContext.runAsUserSet containers' Security Context runAsUser1001
containerSecurityContext.runAsGroupSet containers' Security Context runAsGroup1001
containerSecurityContext.runAsNonRootSet container's Security Context runAsNonRoot

Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://techdocs.broadcom.com/us/en/vmware-tanzu/bitnami-secure-images/bitnami-secure-images/services/bsi-app-doc/apps-charts-pytorch-index.html

Tag summary

Content type

Image

Digest

sha256:727bbdf27

Size

7.8 kB

Last updated

4 days ago

docker pull bitnamicharts/pytorch:sha256-5810041b1806e62ae3f1c62d90066ca98a548093a4f953442d6f7f4eaf80f83a

This week's pulls

Pulls:

6,202

Last week

Bitnami