Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tabacco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
tools
tabacco
Commits
40b21a0b
Commit
40b21a0b
authored
3 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Install litestream in the container image
parent
ea70e62a
No related branches found
No related tags found
1 merge request
!29
Add Litestream
Pipeline
#24157
passed
3 years ago
Stage: test
Stage: build
Stage: release
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+6
-0
6 additions, 0 deletions
Dockerfile
metadb/docker/etc/cont-init.d/10litestream
+14
-10
14 additions, 10 deletions
metadb/docker/etc/cont-init.d/10litestream
metadb/docker/etc/services.d/litestream/run
+5
-0
5 additions, 0 deletions
metadb/docker/etc/services.d/litestream/run
with
25 additions
and
10 deletions
Dockerfile
+
6
−
0
View file @
40b21a0b
...
@@ -4,6 +4,12 @@ RUN cd /src && \
...
@@ -4,6 +4,12 @@ RUN cd /src && \
go build
-ldflags
=
"-extldflags=-static"
-tags
"sqlite_omit_load_extension netgo"
-o
tabacco ./cmd/tabacco
&&
\
go build
-ldflags
=
"-extldflags=-static"
-tags
"sqlite_omit_load_extension netgo"
-o
tabacco ./cmd/tabacco
&&
\
strip tabacco
strip tabacco
FROM
debian:stable-slim
AS
litestream-dl
ENV
LITESTREAM_VERSION=0.3.6
ADD
https://github.com/benbjohnson/litestream/releases/download/v${LITESTREAM_VERSION}/litestream-v${LITESTREAM_VERSION}-linux-amd64-static.tar.gz /tmp/
RUN
tar
-C
/usr/bin
-xzv
-f
/tmp/litestream-v
${
LITESTREAM_VERSION
}
-linux-amd64-static
.tar.gz
&&
chmod
755 /usr/bin/litestream
FROM
registry.git.autistici.org/ai3/docker/s6-base:master
FROM
registry.git.autistici.org/ai3/docker/s6-base:master
COPY
--from=build /src/tabacco /usr/bin/tabacco
COPY
--from=build /src/tabacco /usr/bin/tabacco
COPY
--from=litestream-dl /usr/bin/litestream /usr/bin/litestream
COPY
metadb/docker/etc/ /etc/
COPY
metadb/docker/etc/ /etc/
This diff is collapsed.
Click to expand it.
metadb/docker/etc/cont-init.d/10litestream
+
14
−
10
View file @
40b21a0b
...
@@ -5,6 +5,10 @@ if [ -n "${LITESTREAM_URL}" ]; then
...
@@ -5,6 +5,10 @@ if [ -n "${LITESTREAM_URL}" ]; then
# Query the tabacco configuration to obtain the database path.
# Query the tabacco configuration to obtain the database path.
db_path
=
$(
tabacco metadb-config
--config
=
${
TABACCO_CONF
:-
/etc/tabacco/metadb.yml
}
db-uri
)
db_path
=
$(
tabacco metadb-config
--config
=
${
TABACCO_CONF
:-
/etc/tabacco/metadb.yml
}
db-uri
)
if
[
-z
"
${
db_path
}
"
]
;
then
echo
"Error reading db-uri from tabacco"
>
&2
exit
1
fi
if
[
!
-e
"
${
db_path
}
"
]
;
then
if
[
!
-e
"
${
db_path
}
"
]
;
then
echo
"Database is missing, attempting restore..."
>
&2
echo
"Database is missing, attempting restore..."
>
&2
...
...
This diff is collapsed.
Click to expand it.
metadb/docker/etc/services.d/litestream/run
+
5
−
0
View file @
40b21a0b
#!/bin/sh
#!/bin/sh
db_path
=
$(
tabacco metadb-config
--config
=
${
TABACCO_CONF
:-
/etc/tabacco/metadb.yml
}
db-uri
)
db_path
=
$(
tabacco metadb-config
--config
=
${
TABACCO_CONF
:-
/etc/tabacco/metadb.yml
}
db-uri
)
if
[
-z
"
${
db_path
}
"
]
;
then
echo
"Error reading db-uri from tabacco"
>
&2
sleep
3
exit
1
fi
exec
litestream replicate
"
${
db_path
}
"
"
${
LITESTREAM_URL
}
"
exec
litestream replicate
"
${
db_path
}
"
"
${
LITESTREAM_URL
}
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment