mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
chore: Remove some of the things that are missing
This commit is contained in:
@@ -443,11 +443,8 @@ async fn restore_package<'a>(
|
||||
Ok((
|
||||
progress.clone(),
|
||||
async move {
|
||||
tracing::error!("BLUJ downloading {id}");
|
||||
download_install_s9pk(&ctx, &manifest, None, progress, file, None).await?;
|
||||
tracing::error!("BLUJ downlowded {id}");
|
||||
guard.unmount().await?;
|
||||
tracing::error!("BLUJ unmounted {id}");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1167,7 +1167,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
tracing::error!("BLUJ 1");
|
||||
let current_dependents = {
|
||||
let mut deps = BTreeMap::new();
|
||||
for package in crate::db::DatabaseModel::new()
|
||||
@@ -1215,14 +1214,12 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
}
|
||||
CurrentDependents(deps)
|
||||
};
|
||||
tracing::error!("BLUJ 2");
|
||||
let mut pde = model
|
||||
.clone()
|
||||
.expect(&mut tx)
|
||||
.await?
|
||||
.get_mut(&mut tx)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 3");
|
||||
let installed = InstalledPackageDataEntry {
|
||||
status: Status {
|
||||
configured: manifest.config.is_none(),
|
||||
@@ -1249,7 +1246,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
current_dependencies: current_dependencies.clone(),
|
||||
interface_addresses,
|
||||
};
|
||||
tracing::error!("BLUJ 4");
|
||||
let prev = std::mem::replace(
|
||||
&mut *pde,
|
||||
PackageDataEntry::Installed {
|
||||
@@ -1258,9 +1254,7 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
static_files,
|
||||
},
|
||||
);
|
||||
tracing::error!("BLUJ 5");
|
||||
pde.save(&mut tx).await?;
|
||||
tracing::error!("BLUJ 6");
|
||||
let receipts = InstallS9Receipts::new(&mut tx).await?;
|
||||
// UpdateDependencyReceipts
|
||||
let mut dep_errs = model
|
||||
@@ -1273,7 +1267,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
.dependency_errors()
|
||||
.get_mut(&mut tx)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 7");
|
||||
*dep_errs = DependencyErrors::init(
|
||||
ctx,
|
||||
&mut tx,
|
||||
@@ -1282,9 +1275,7 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.try_heal_receipts,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 8");
|
||||
dep_errs.save(&mut tx).await?;
|
||||
tracing::error!("BLUJ 9");
|
||||
|
||||
if let PackageDataEntry::Updating {
|
||||
installed: prev, ..
|
||||
@@ -1320,7 +1311,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
migration.or(prev_migration)
|
||||
};
|
||||
|
||||
tracing::error!("BLUJ 9.1");
|
||||
remove_from_current_dependents_lists(
|
||||
&mut tx,
|
||||
pkg_id,
|
||||
@@ -1328,14 +1318,12 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.current_dependents,
|
||||
)
|
||||
.await?; // remove previous
|
||||
tracing::error!("BLUJ 9.2");
|
||||
|
||||
let configured = if let Some(f) = viable_migration {
|
||||
f.await?.configured && prev_is_configured
|
||||
} else {
|
||||
false
|
||||
};
|
||||
tracing::error!("BLUJ 9.3");
|
||||
if configured && manifest.config.is_some() {
|
||||
let breakages = BTreeMap::new();
|
||||
let overrides = Default::default();
|
||||
@@ -1348,7 +1336,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
overrides,
|
||||
};
|
||||
crate::config::configure(&ctx, pkg_id, configure_context).await?;
|
||||
tracing::error!("BLUJ 9.4");
|
||||
} else {
|
||||
add_dependent_to_current_dependents_lists(
|
||||
&mut tx,
|
||||
@@ -1357,7 +1344,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.current_dependents,
|
||||
)
|
||||
.await?; // add new
|
||||
tracing::error!("BLUJ 9.5");
|
||||
}
|
||||
if configured || manifest.config.is_none() {
|
||||
let mut main_status = crate::db::DatabaseModel::new()
|
||||
@@ -1372,10 +1358,8 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
.main()
|
||||
.get_mut(&mut tx)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.6");
|
||||
*main_status = prev.status.main;
|
||||
main_status.save(&mut tx).await?;
|
||||
tracing::error!("BLUJ 9.7");
|
||||
}
|
||||
update_dependency_errors_of_dependents(
|
||||
ctx,
|
||||
@@ -1389,13 +1373,10 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.update_dependency_receipts,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.8");
|
||||
if &prev.manifest.version != version {
|
||||
cleanup(ctx, &prev.manifest.id, &prev.manifest.version).await?;
|
||||
}
|
||||
tracing::error!("BLUJ 9.9");
|
||||
} else if let PackageDataEntry::Restoring { .. } = prev {
|
||||
tracing::error!("BLUJ 9.10");
|
||||
manifest
|
||||
.backup
|
||||
.restore(
|
||||
@@ -1407,7 +1388,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&manifest.volumes,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.11");
|
||||
add_dependent_to_current_dependents_lists(
|
||||
&mut tx,
|
||||
pkg_id,
|
||||
@@ -1415,7 +1395,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.current_dependents,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.12");
|
||||
update_dependency_errors_of_dependents(
|
||||
ctx,
|
||||
&mut tx,
|
||||
@@ -1424,9 +1403,7 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.update_dependency_receipts,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.13");
|
||||
} else {
|
||||
tracing::error!("BLUJ 9.14");
|
||||
add_dependent_to_current_dependents_lists(
|
||||
&mut tx,
|
||||
pkg_id,
|
||||
@@ -1434,7 +1411,6 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.current_dependents,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.15");
|
||||
update_dependency_errors_of_dependents(
|
||||
ctx,
|
||||
&mut tx,
|
||||
@@ -1443,20 +1419,15 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin + Send + Sync>(
|
||||
&receipts.config.update_dependency_receipts,
|
||||
)
|
||||
.await?;
|
||||
tracing::error!("BLUJ 9.16");
|
||||
}
|
||||
tracing::error!("BLUJ 10");
|
||||
|
||||
if let Some(installed) = pde.installed() {
|
||||
reconfigure_dependents_with_live_pointers(ctx, &mut tx, &receipts.config, installed)
|
||||
.await?;
|
||||
}
|
||||
tracing::error!("BLUJ 11");
|
||||
|
||||
sql_tx.commit().await?;
|
||||
tracing::error!("BLUJ 12");
|
||||
tx.commit().await?;
|
||||
tracing::error!("BLUJ 13");
|
||||
|
||||
tracing::info!("Install {}@{}: Complete", pkg_id, version);
|
||||
|
||||
|
||||
@@ -267,7 +267,6 @@ impl Manager {
|
||||
let _ = manage_container
|
||||
.set_override(Some(get_status(&mut tx, &seed.manifest).await.backing_up()));
|
||||
manage_container.wait_for_desired(StartStop::Stop).await;
|
||||
|
||||
let backup_guard = backup_guard.lock().await;
|
||||
let guard = backup_guard.mount_package_backup(&seed.manifest.id).await?;
|
||||
|
||||
|
||||
@@ -228,12 +228,10 @@ impl DockerProcedure {
|
||||
input: Option<I>,
|
||||
timeout: Option<Duration>,
|
||||
) -> Result<Result<O, (i32, String)>, Error> {
|
||||
tracing::error!("BLUJ Backup 1");
|
||||
let name = name.docker_name();
|
||||
let name: Option<&str> = name.as_ref().map(|x| &**x);
|
||||
let mut cmd = tokio::process::Command::new("docker");
|
||||
let container_name = Self::container_name(pkg_id, name);
|
||||
tracing::error!("BLUJ Backup 2");
|
||||
cmd.arg("run")
|
||||
.arg("--rm")
|
||||
.arg("--network=start9")
|
||||
@@ -243,7 +241,6 @@ impl DockerProcedure {
|
||||
.arg(format!("--hostname={}", &container_name))
|
||||
.arg("--no-healthcheck")
|
||||
.kill_on_drop(true);
|
||||
tracing::error!("BLUJ Backup 3");
|
||||
match ctx
|
||||
.docker
|
||||
.remove_container(
|
||||
@@ -263,9 +260,7 @@ impl DockerProcedure {
|
||||
}) => Ok(()),
|
||||
Err(e) => Err(e),
|
||||
}?;
|
||||
tracing::error!("BLUJ Backup 4");
|
||||
cmd.args(self.docker_args(ctx, pkg_id, pkg_version, volumes).await?);
|
||||
tracing::error!("BLUJ Backup 5");
|
||||
let input_buf = if let (Some(input), Some(format)) = (&input, &self.io_format) {
|
||||
cmd.stdin(std::process::Stdio::piped());
|
||||
Some(format.to_vec(input)?)
|
||||
@@ -281,9 +276,7 @@ impl DockerProcedure {
|
||||
.collect::<Vec<&str>>()
|
||||
.join(" ")
|
||||
);
|
||||
tracing::error!("BLUJ Backup 6");
|
||||
let mut handle = cmd.spawn().with_kind(crate::ErrorKind::Docker)?;
|
||||
tracing::error!("BLUJ Backup 7");
|
||||
let id = handle.id();
|
||||
let timeout_fut = if let Some(timeout) = timeout {
|
||||
EitherFuture::Right(async move {
|
||||
@@ -296,15 +289,12 @@ impl DockerProcedure {
|
||||
};
|
||||
if let (Some(input), Some(mut stdin)) = (&input_buf, handle.stdin.take()) {
|
||||
use tokio::io::AsyncWriteExt;
|
||||
tracing::error!("BLUJ Backup 8");
|
||||
stdin
|
||||
.write_all(input)
|
||||
.await
|
||||
.with_kind(crate::ErrorKind::Docker)?;
|
||||
stdin.flush().await?;
|
||||
tracing::error!("BLUJ Backup 9");
|
||||
stdin.shutdown().await?;
|
||||
tracing::error!("BLUJ Backup 10");
|
||||
drop(stdin);
|
||||
}
|
||||
enum Race<T> {
|
||||
|
||||
Reference in New Issue
Block a user