Skip to content

Commit d9b5b52

Browse files
bradarmBrad Armstrong
and
Brad Armstrong
authored
stage wheels into coresvc-registry (#88)
* adds pyi helper scripts that will later be moved to documentation * stage the spacefx wheel into coresvc-registry's pypi server * removes pypiserver directory * move the wheels instead of copying them * adds wheel/.gitkeep --------- Co-authored-by: Brad Armstrong <[email protected]>
1 parent a1aeab0 commit d9b5b52

File tree

6 files changed

+19
-92
lines changed

6 files changed

+19
-92
lines changed

.vscode/copy_to_spacedev.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function main() {
8686
copy_directory_to_dest --directory "env"
8787
copy_directory_to_dest --directory "modules"
8888
copy_directory_to_dest --directory "protos"
89-
copy_directory_to_dest --directory "pypiserver"
89+
copy_directory_to_dest --directory "wheel"
9090
copy_directory_to_dest --directory "scripts"
9191

9292
while read -r shellFile; do

chart/templates/coresvc_registry.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ spec:
6363
mountPath: /var/lib/registry
6464
- name: registry-cert-mount
6565
mountPath: /certs
66-
- name: pypiserver-data-mount
67-
mountPath: /data
66+
- name: pypiserver-packages-mount
67+
mountPath: /data/packages
6868
volumes:
69-
- name: pypiserver-data-mount
69+
- name: pypiserver-packages-mount
7070
hostPath:
71-
path: {{ $globalValues.spacefxDirectories.base }}/registry/pypiserver
71+
path: {{ $globalValues.spacefxDirectories.base }}/registry/pypiserver/packages
7272
type: DirectoryOrCreate
7373
- name: registry-data-mount
7474
hostPath:

pypiserver/scripts/stage_python_packages.sh

-68
This file was deleted.

scripts/coresvc_registry.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function start_registry_docker(){
326326
-v ${SPACEFX_DIR}/registry/data:/var/lib/registry \
327327
-v ${SPACEFX_DIR}/certs/registry:/certs \
328328
-v ${SPACEFX_DIR}/certs/ca/ca.spacefx.local.pem:/etc/pki/ca-trust/source/anchors/ca.spacefx.local.pem:ro \
329-
-v ${SPACEFX_DIR}/pypiserver:/data \
329+
-v ${SPACEFX_DIR}/registry/pypiserver/packages:/data/packages \
330330
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.spacefx.local.crt \
331331
-e REGISTRY_HTTP_TLS_KEY=/certs/registry.spacefx.local.key \
332332
--name=${REGISTRY_REPO} ${coresvc_registry_parent}/${_repo_name}:${spacefx_version_tag}"

scripts/stage_spacefx.sh

+13-18
Original file line numberDiff line numberDiff line change
@@ -506,21 +506,17 @@ function stage_build_artifacts(){
506506
function stage_python_wheels(){
507507
info_log "START: ${FUNCNAME[0]}"
508508

509-
if [[ ! -f "${SPACEFX_DIR}/pypiserver/requirements.txt" ]]; then
510-
info_log "...no requirements file found at '${SPACEFX_DIR}/pypiserver/requirements.txt'. Nothing to do."
511-
info_log "END: ${FUNCNAME[0]}"
512-
return
513-
fi
509+
# Stage the microsoft-azure-orbital-sdk wheel to the wheel directory
510+
run_a_script "${SPACEFX_DIR}/scripts/stage/stage_build_artifact.sh --architecture ${ARCHITECTURE} --artifact microsoftazurespacefx-${SPACEFX_VERSION}-py3-none-any.whl"
514511

515-
if [[ ! -s "${SPACEFX_DIR}/pypiserver/requirements.txt" ]]; then
516-
info_log "...the requirements file '${SPACEFX_DIR}/pypiserver/requirements.txt' is empty. Nothing to do. Nothing to do."
517-
info_log "END: ${FUNCNAME[0]}"
518-
return
519-
fi
512+
# Find all wheels in the ${SPACEFX_DIR}/wheel directory and move them to the ${SPACEFX_DIR}/registry/pypiserver/packages directory
513+
# Move only the wheel itself to the root level of the ${SPACEFX_DIR}/registry/pypiserver/packages directory and not the entire directory structure
514+
# The pypiserver will detect these wheels and serve the python packages when it boots up
515+
run_a_script "mkdir -p ${SPACEFX_DIR}/registry/pypiserver/packages"
516+
run_a_script "find ${SPACEFX_DIR}/wheel -type f -name '*.whl' -exec mv {} ${SPACEFX_DIR}/registry/pypiserver/packages \;"
520517

521-
info_log "Staging python wheels..."
522-
run_a_script "docker exec coresvc-registry /data/scripts/stage_python_packages.sh"
523-
info_log "...successfully staged python wheels."
518+
# Remove the wheel directory
519+
run_a_script "rm -rf ${SPACEFX_DIR}/wheel"
524520

525521
info_log "FINISHED: ${FUNCNAME[0]}"
526522
}
@@ -594,6 +590,10 @@ function main() {
594590
enable_fileserver
595591
_generate_spacefx_config_json
596592

593+
info_log "Staging python wheels..."
594+
stage_python_wheels
595+
info_log "...successfully staged python wheels"
596+
597597
info_log "Staging coresvc-registry..."
598598
stage_coresvc_registry
599599
info_log "...successfully staged coresvc-registry"
@@ -626,13 +626,8 @@ function main() {
626626
stage_spacefx_service_images --service_group host
627627
info_log "...service images successfully staged."
628628

629-
630-
stage_python_wheels
631-
632-
633629
remove_channels_from_extra_containers
634630

635-
636631
info_log "Stopping coresvc-registry..."
637632
run_a_script "${SPACEFX_DIR}/scripts/coresvc_registry.sh --stop"
638633
info_log "...successfully stopped coresvc-registry"
File renamed without changes.

0 commit comments

Comments
 (0)