Adding support for local mirror mount and STX_MIRROR env variable

Adds STX_MIRROR as environment variable on the build containers and
mount the /workspace/mirrors/starlingx directory into the containers
at /import/mirrors/starlingx during helm provisioning, If directory
does not exists K8s will create an empty directory.

Minikube mounts $STX_BUILD_HOME as /workspace hence why we need
/workspace/<dir> on the yaml files which will mount our local
directories into the containers.

Story: 2008846
Task: 43768

Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I1983ca8868e24bb7b734f122500fcfbc167cc9f7
This commit is contained in:
Luis Sampaio 2021-10-26 12:01:51 -07:00
parent 35e8abc535
commit 3cd4bf20c6
5 changed files with 22 additions and 0 deletions

View File

@ -39,6 +39,8 @@ spec:
mountPath: {{ .Values.volumeMounts.mountPath}}
- name: {{ .Values.volumeMounts.envsetupname }}
mountPath: {{ .Values.volumeMounts.envsetupmountPath}}
- name: {{ .Values.volumeMounts.mirrorName }}
mountPath: {{ .Values.volumeMounts.mirrorMountPath }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
@ -50,6 +52,9 @@ spec:
- name: {{ .Values.volumes.envsetupname }}
configMap:
name: {{ .Values.volumes.configmapname }}
- name: {{ .Values.volumes.mirrorName }}
hostPath:
path: {{ .Values.volumes.mirrorHostPath.path }}
{{- with .Values.nodeSelector }}
nodeSelector:

View File

@ -16,6 +16,8 @@ volumeMounts:
mountPath: /localdisk
envsetupname: env-setting
envsetupmountPath: /usr/local/bin/stx
mirrorName: mirror
mirrorMountPath: /import/mirrors/starlingx
volumes:
name: shared-workspace
@ -23,6 +25,9 @@ volumes:
path: /workspace/localdisk
envsetupname: env-setting
configmapname: pkgbuilder
mirrorName: mirror
mirrorHostPath:
path: /workspace/mirrors/starlingx
imagePullSecrets: []
nameOverride: ""

View File

@ -39,6 +39,8 @@ spec:
mountPath: {{ .Values.volumeMounts.mountPath}}
- name: {{ .Values.volumeMounts.usersetupname }}
mountPath: {{ .Values.volumeMounts.usersetupmountPath}}
- name: {{ .Values.volumeMounts.mirrorName }}
mountPath: {{ .Values.volumeMounts.mirrorMountPath }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
@ -50,6 +52,9 @@ spec:
- name: {{ .Values.volumes.usersetupname }}
configMap:
name: {{ .Values.volumes.configmapname }}
- name: {{ .Values.volumes.mirrorName }}
hostPath:
path: {{ .Values.volumes.mirrorHostPath.path }}
{{- with .Values.nodeSelector }}
nodeSelector:

View File

@ -16,6 +16,8 @@ volumeMounts:
mountPath: /localdisk
usersetupname: user-setting
usersetupmountPath: /usr/local/bin/stx
mirrorName: mirror
mirrorMountPath: /import/mirrors/starlingx
volumes:
name: shared-workspace
@ -23,6 +25,9 @@ volumes:
path: /workspace/localdisk
usersetupname: user-setting
configmapname: builder
mirrorName: mirror
mirrorHostPath:
path: /workspace/mirrors/starlingx
imagePullSecrets: []
nameOverride: ""

View File

@ -34,3 +34,5 @@ export STX_GIT_SRC_DIR=$MY_REPO/stx/git
export PATH=$PATH:$MY_BUILD_TOOLS_DIR/stx:/opt/LAT/lat
export PYTHONPATH=$PYTHONPATH:$MY_BUILD_TOOLS_DIR/stx
export STX_MIRROR=/import/mirrors/starlingx