专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

semtech/mu-migrations-service Docker 镜像 - 轩辕镜像

mu-migrations-service
semtech/mu-migrations-service
自动构建
Service for running database migrations
1 收藏0 次下载
🙃 代码没问题,结果发布失败在拉镜像
镜像简介版本下载
🙃 代码没问题,结果发布失败在拉镜像

mu-migrations-service

The mu-migrations-service runs migrations on the database. This currently includes SPARQL queries (*.sparql) and Turtle files (*.ttl). We intend more formats to be supported in the future.

Tutorials

Add the migrations service to a stack

To install the migrations service in your project, add the migrations-service to the docker-compose.yml file of your mu-project by adding the following snippet:

    migrations:
      image: semtech/mu-migrations-service
      links:
        - triplestore:database
      volumes:
        - ./config/migrations:/data/migrations

triplestore is the service name of the database (probably a Virtuoso instance) running in your stack.

Start your stack using docker-compose up -d. The migrations service will be created.

Execute docker-compose logs -ft migrations to inspect the logs of the service. You will see the migrations service started up successfully. No migrations are executed since we didn't define one yet. Let's go to the next step and create our first migration!

Writing a migration to update a predicate in your dataset

We're going to define a migration that will change all predicates schema:name in our dataset to foaf:name.

First, create a new migration file ./config/migrations/20200329140538-replace-schema-name-with-foaf-name.sparql. Next, insert the SPARQL query to execute the change in the file.

    PREFIX schema: <[***]>
    PREFIX foaf: <[***]>

    DELETE {
      GRAPH ?g { ?s schema:name ?o . }
    } INSERT {
      GRAPH ?g { ?s foaf:name ?o . }
    } WHERE {
      GRAPH ?g { ?s schema:name ?o . }
    }

Restart the migrations service by running docker-compose restart migrations. Inspect the logs using docker-compose logs -ft migrations. You will see the migration gets executed and the success status is printed in the migrations summary in the logs.

How-to guides

Manipulating data using a SPARQL query

Specify the migration in a file, like ./config/migrations/20160808225103-statuses.sparql containing a SPARQL query like:

    PREFIX dct: <[***]>
    PREFIX tac: <[***]>
    PREFIX ext: <[***]>
    PREFIX rm: <[***]>
    PREFIX typedLiterals: <[***]>
    PREFIX mu: <[***]>
    PREFIX xsd: <[***]>
    PREFIX app: <[***]>
    PREFIX owl: <[***]>
    PREFIX rdf: <[***]>
    INSERT DATA {
      GRAPH <[***]> {
        <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-not_started";
          dct:title "not started".
        <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-ongoing";
          dct:title "ongoing".
        <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-done";
          dct:title "done".
      }
    }
Inserting data in the default graph using Turtle files

Specify the migration in a file, like ./config/migrations/20160808225103-statuses.ttl containing triples in Turtle format like:

    @prefix dct: <[***]> .
    @prefix tac: <[***]> .
    @prefix ext: <[***]> .
    @prefix rm: <[***]> .
    @prefix typedLiterals: <[***]> .
    @prefix mu: <[***]> .
    @prefix xsd: <[***]> .
    @prefix app: <[***]> .
    @prefix owl: <[***]> .
    @prefix rdf: <[***]> .

    <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-not_started";
          dct:title "not started".
    <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-ongoing";
          dct:title "ongoing".
    <[***]>
          a tac:Status;
          mu:uuid "wellknown-status-done";
          dct:title "done".

By default, the Turtle files will be imported in the <[***]> graph.

Inserting data in a specific graph using Turtle files (experimental)

To insert data in a specific graph instead of the default graph, create a .graph-file by the same name as the .ttl-file. E.g. ./config/migrations/20160808225103-statuses.graph for a Turtle migration named ./config/migrations/20160808225103-statuses.ttl.

The .graph file contains only one line, specifying the graph name to insert the data in:

[***]

Reference

Naming and organizing the migrations

Migrations are specified in files, to be executed in the order of their filename. All the files need to be available in /data/migrations inside the docker container, but the may be organized in subfolders.

The name of a migration file must always start with a number and be unique across all migrations (also migrations stored in other folders!). It is advised to use the unix system time as the basis for the filename of your migration, postfixed with a short name of what the migration performs. E.g. 20200329140538-replace-schema-name-with-foaf-name.sparql.

Since the execution state of a migration is determined only be the filename and not the full file path, subfolders may be reorganized after execution of a migration. This allows for example to archive migrations in subfolders per year while the project progresses.

Execution guarantees

The migrations service provides the following guarantees of execution:

  • Migrations are run sequentially in order of the first number in the filename, in ascending order.
  • A migration has to complete successfully in order for the next migration to start, there is no concurrent execution of migrations.
  • If a migration fails to run, no subsequent migrations will be attempted.
  • A migration that has been marked as completed will not be started again nor will a migration with the same filename be executed.
Migration management in the database

The completion of a migration is stored in the database in the MU_APPLICATION_GRAPH (default: <[***]>).

Each successfully executed migration is represented by a resource of type muMigr:Migration with the following properties:

  • muMigr:filename: name of the migration file
  • muMigr:executedAt: datetime when the migration successfully finished

Used prefix: muMigr: <[***]>

Configuration

The migration service supports configuration via environment variables.

  • BATCH_SIZE: amount of triples to insert in one go for a Turtle migration (default: ***)
  • MINIMUM_BATCH_SIZE: if the batch size drops below this number the service will stop with an error. (default: 100)
  • COUNT_BATCH_SIZE: number of executed migrations to retrieve from the database in one go (default: ***)

This microservice is based on the mu-ruby template and supports the environment variables documented in its README.

Discussions

Large datasets and batch size

Triple stores typically can only handle a certain amount of triples to be ingested per request. The migration service supports batching to split of large datasets in multiple requests. This can be configured with the BATCH_SIZE environment variable. If an error occurs during batch ingestion the batch size will be halved and the request retried until MINIMUM_BATCH_SIZE is reached. At this point an error will be thrown.

To make sure a dataset is loaded completely it will first be ingested into a temporary graph, on success the contents will be added to the target graph with a SPARQL Graph query.

Working with mu-authorization

Experimental: You can hook the migrations service onto mu-authorization. The migrations service will add the mu-auth-sudo header and execute migrations with elevated priviledges. Support is experimental and we'd love to hear about your experience with this feature so we can harden it.

查看更多 mu-migrations-service 相关镜像 →
jetbrains/ide-services-migrations logo
jetbrains/ide-services-migrations
JetBrains官方IDE服务辅助镜像,主要用于数据库迁移操作。
4.0K pulls
上次更新:未知
bitnami/chainloop-control-plane-migrations logo
bitnami/chainloop-control-plane-migrations
Bitnami chainloop-control-plane-migrations安全镜像,提供Debian和Photon基础OS格式,需通过商业订阅获取,具备高安全性、合规性及供应链安全支持。
50K+ pulls
上次更新:未知
rancher/lb-service-haproxy logo
rancher/lb-service-haproxy
暂无描述
810M+ pulls
上次更新:未知
tractusx/portal-portal-migrations logo
tractusx/portal-portal-migrations
Eclipse Tractus-X的portal-portal-migrations镜像,包含Portal Checklist Worker组件,基于.NET 9.0 Alpine运行时,用于门户后端的数据迁移及相关任务处理。
10K+ pulls
上次更新:未知
zabbix/zabbix-web-service logo
zabbix/zabbix-web-service
Zabbix Web服务,通过无头浏览器执行各类任务(如报告生成)。
71M+ pulls
上次更新:未知
docker/desktop-docker-debug-service logo
docker/desktop-docker-debug-service
暂无描述
5M+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
semtech/mu-migrations-service
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.