Skip to content

Commit

Permalink
Merge 5c12e06 into a98a23c
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jan 18, 2024
2 parents a98a23c + 5c12e06 commit a8a98cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion renku/core/migration/migrate.py
Expand Up @@ -142,7 +142,12 @@ def migrate_project(
except Exception as e:
raise TemplateUpdateError("Couldn't update from template.") from e

if not skip_docker_update:
if (
not skip_docker_update
and project
and hasattr(project, "template_metadata")
and isinstance(project.template_metadata, ProjectTemplateMetadata)
):
try:
docker_updated, _, _ = update_dockerfile()
except DockerfileUpdateError:
Expand Down
16 changes: 15 additions & 1 deletion renku/ui/service/controllers/cache_migrate_project.py
Expand Up @@ -30,13 +30,27 @@ def execute_migration(
project_path, force_template_update, skip_template_update, skip_docker_update, skip_migrations, commit_message
):
"""Execute project migrations."""
from renku.command.migrate import migrate_project_command
from renku.command.migrate import (
AUTOMATED_TEMPLATE_UPDATE_SUPPORTED,
DOCKERFILE_UPDATE_POSSIBLE,
TEMPLATE_UPDATE_POSSIBLE,
check_project,
migrate_project_command,
)

worker_log.debug(f"migrating {project_path}")

communicator = ServiceCallback()

with renku_project_context(project_path):
status = check_project().build().execute().output

template_update_possible = status & TEMPLATE_UPDATE_POSSIBLE and status & AUTOMATED_TEMPLATE_UPDATE_SUPPORTED
docker_update_possible = status & DOCKERFILE_UPDATE_POSSIBLE

skip_docker_update = skip_docker_update or not docker_update_possible
skip_template_update = skip_template_update or not template_update_possible

result = (
migrate_project_command()
.with_commit(message=commit_message)
Expand Down

0 comments on commit a8a98cd

Please sign in to comment.