pub(crate) async fn download_release_package(
        &self,
        replica_version: ReplicaVersion,
    ) -> OrchestratorResult<ReleaseContent> {
        self.gc_release_packages();

        let version_dir = self.make_version_dir(&replica_version)?;

        let replica_version_record = self.registry.get_replica_version_record(
            replica_version.clone(),
            self.registry.get_latest_version(),
        )?;

        let tar_gz_path = version_dir.join("base-os.tar.gz");
        info!(
            self.logger,
            "Downloading release package for replica version {} from {} to {:?}",
            replica_version.as_ref(),
            &replica_version_record.release_package_url,
            &tar_gz_path,
        );

        let tar_gz_path = version_dir.join("base-os.tar.gz");
        self.file_downloader
            .download_file(
                &replica_version_record.release_package_url,
                &tar_gz_path,
                Some(replica_version_record.release_package_sha256_hex),
            )
            .await
            .map_err(OrchestratorError::from)?;

        let content = ReleaseContent::try_from(version_dir.as_path());
        if let Err(e) = &content {
            warn!(
                self.logger,
                "Failed to create release content in download release package at {:?}: {:?}",
                version_dir,
                e
            );
        }
        content.map_err(OrchestratorError::ReleasePackageError)
    }
/// Return the release package associated with the given version
///
/// If a dir already exists for the given replica version, we remove this
/// dir and all of its contents. This prevents issues where the dir
/// exists but contains unexpected files or is missing expected files.
///
/// If no release package URL or hash is defined for the given replica
/// version's ReplicaVersionRecord, we attempt to construct a release
/// package from the record's replica and orchestrator URLs.
///
/// Previously downloaded releases will be delete if redownload is set to
/// true.
Return the release package associated with the given version
If a dir already exists for the given replica version, we remove this
dir and all of its contents. This prevents issues where the dir
exists but contains unexpected files or is missing expected files.

If no release package URL or hash is defined for the given replica
version's ReplicaVersionRecord, we attempt to construct a release
package from the record's replica and orchestrator URLs.

Previously downloaded releases will be delete if redownload is set to
true.
Return the release package associated with the given version If a dir already exists for the given replica version we remove this dir and all of its contents . This prevents issues where the dir exists but contains unexpected files or is missing expected files . If no release package URL or hash is defined for the given replica version ' s ReplicaVersionRecord we attempt to construct a release package from the record ' s replica and orchestrator URLs . Previously downloaded releases will be delete if redownload is set to true .
pub(crate) async fn download_release_package(
        &self,
        replica_version: ReplicaVersion,
    ) -> OrchestratorResult<ReleaseContent> {
        self.gc_release_packages();
        let version_dir = self.make_version_dir(&replica_version)?;
        let replica_version_record = self.registry.get_replica_version_record(
            replica_version.clone(),
            self.registry.get_latest_version(),
        )?;
        let tar_gz_path = version_dir.join("base-os.tar.gz");
        info!(
            self.logger,
            "Downloading release package for replica version {} from {} to {:?}",
            replica_version.as_ref(),
            &replica_version_record.release_package_url,
            &tar_gz_path,
        );
        let tar_gz_path = version_dir.join("base-os.tar.gz");
        self.file_downloader
            .download_file(
                &replica_version_record.release_package_url,
                &tar_gz_path,
                Some(replica_version_record.release_package_sha256_hex),
            )
            .await
            .map_err(OrchestratorError::from)?;
        let content = ReleaseContent::try_from(version_dir.as_path());
        if let Err(e) = &content {
            warn!(
                self.logger,
                "Failed to create release content in download release package at {:?}: {:?}",
                version_dir,
                e
            );
        }
        content.map_err(OrchestratorError::ReleasePackageError)
    }
pub ( crate ) async fn download_release_package ( & self , replica_version : ReplicaVersion , ) -> OrchestratorResult < ReleaseContent > { self . gc_release_packages ( ) ; let version_dir = self . make_version_dir ( & replica_version ) ? ; let replica_version_record = self . registry . get_replica_version_record ( replica_version . clone ( ) , self . registry . get_latest_version ( ) , ) ? ; let tar_gz_path = version_dir . join ( " " ) ; info ! ( self logger " " replica_version as_ref ( ) replica_version_record release_package_url tar_gz_path ) ; let tar_gz_path = version_dir . join ( " " ) ; self . file_downloader . download_file ( & replica_version_record . release_package_url , & tar_gz_path , Some ( replica_version_record . release_package_sha256_hex ) , ) . await . map_err ( OrchestratorError :: from ) ? ; let content = ReleaseContent :: try_from ( version_dir . as_path ( ) ) ; if let Err ( e ) = & content { warn ! ( self logger " " version_dir e ) ; } content . map_err ( OrchestratorError :: ReleasePackageError ) }
Return the release package associated with the given version
If a dir already exists for the given replica version, we remove this
dir and all of its contents.
Return the release package associated with the given version If a dir already exists for the given replica version we remove this dir and all of its contents .
&self
replica_version
ReplicaVersion
&self
replica_version
ReplicaVersion