Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
PrivateStorage
PrivateStorageio
Commits
b9f54520
Commit
b9f54520
authored
1 year ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
Add a read-only GBS (and Foolscap) server on another port
parent
78d66278
No related branches found
No related tags found
2 merge requests
!395
Add a read-only Great Black Swamp storage server to each storage node
,
!384
update production
Pipeline
#4889
passed
1 year ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
nixos/modules/private-storage.nix
+38
-2
38 additions, 2 deletions
nixos/modules/private-storage.nix
nixos/tests/exercise-storage.py
+6
-1
6 additions, 1 deletion
nixos/tests/exercise-storage.py
with
44 additions
and
3 deletions
nixos/modules/private-storage.nix
+
38
−
2
View file @
b9f54520
...
@@ -67,6 +67,14 @@ in
...
@@ -67,6 +67,14 @@ in
The port number on which to service storage clients.
The port number on which to service storage clients.
''
;
''
;
};
};
services
.
private-storage
.
publicReadOnlyStoragePort
=
lib
.
mkOption
{
default
=
8899
;
type
=
lib
.
types
.
int
;
example
=
8099
;
description
=
''
The port number on which to service read-only storage clients.
''
;
};
services
.
private-storage
.
issuerRootURL
=
lib
.
mkOption
services
.
private-storage
.
issuerRootURL
=
lib
.
mkOption
{
default
=
"https://issuer.
${
config
.
networking
.
domain
}
/"
;
{
default
=
"https://issuer.
${
config
.
networking
.
domain
}
/"
;
type
=
lib
.
types
.
str
;
type
=
lib
.
types
.
str
;
...
@@ -96,7 +104,35 @@ in
...
@@ -96,7 +104,35 @@ in
# Define configuration based on values given for our options - starting with
# Define configuration based on values given for our options - starting with
# the option that says whether this is even turned on.
# the option that says whether this is even turned on.
config
=
lib
.
mkIf
cfg
.
enable
config
=
lib
.
mkIf
cfg
.
enable
{
services
.
tahoe
.
nodes
.
"
${
storage-node-name
}
"
=
{
# A read-only storage service. This allows read-only access for clients
# that use Great Black Swamp. There is no ZKAP/GBS integration yet so
# this is the most we can do at the moment.
services
.
tahoe
.
nodes
.
"ro-
${
storage-node-name
}
"
=
{
package
=
cfg
.
tahoe
.
package
;
sections
=
{
client
=
if
cfg
.
introducerFURL
==
null
then
{}
else
{
"introducer.furl"
=
cfg
.
introducerFURL
;
};
node
=
{
nickname
=
"ro-
${
storage-node-name
}
"
;
"tub.port"
=
"tcp:
${
toString
cfg
.
publicReadOnlyStoragePort
}
"
;
"tub.location"
=
"tcp:
${
cfg
.
publicAddress
}
:
${
toString
cfg
.
publicReadOnlyStoragePort
}
"
;
};
storage
=
{
enabled
=
true
;
storage_dir
=
"/storage"
;
readonly
=
true
;
force_foolscap
=
false
;
};
};
};
# Tahoe nixos module brings along a single socket for the web api.
# That's for the other storage node though. Turn off the integration
# with this one.
systemd
.
services
.
"tahoe.ro-storage"
.
unitConfig
.
Requires
=
[];
services
.
tahoe
.
nodes
.
"
${
storage-node-name
}
"
=
{
package
=
cfg
.
tahoe
.
package
;
{
package
=
cfg
.
tahoe
.
package
;
# Each attribute in this set corresponds to a section in the
# Each attribute in this set corresponds to a section in the
# tahoe.cfg file. Attributes on those sets correspond to individual
# tahoe.cfg file. Attributes on those sets correspond to individual
...
@@ -147,7 +183,7 @@ in
...
@@ -147,7 +183,7 @@ in
};
};
# Let traffic destined for the storage node's Foolscap server through.
# Let traffic destined for the storage node's Foolscap server through.
networking
.
firewall
.
allowedTCPPorts
=
[
cfg
.
publicStoragePort
];
networking
.
firewall
.
allowedTCPPorts
=
[
cfg
.
publicStoragePort
cfg
.
publicReadOnlyStoragePort
];
systemd
.
tmpfiles
.
rules
=
systemd
.
tmpfiles
.
rules
=
# Add a rule to prevent incident reports from accumulating indefinitely.
# Add a rule to prevent incident reports from accumulating indefinitely.
...
...
This diff is collapsed.
Click to expand it.
nixos/tests/exercise-storage.py
+
6
−
1
View file @
b9f54520
...
@@ -47,7 +47,12 @@ def block_until_connected(api_root):
...
@@ -47,7 +47,12 @@ def block_until_connected(api_root):
in
servers
in
servers
if
server
[
"
connection_status
"
].
startswith
(
"
Connected to
"
)
if
server
[
"
connection_status
"
].
startswith
(
"
Connected to
"
)
)
)
if
len
(
connected
)
>=
1
:
# There is a read-only server and a read-write server! The easiest
# way to be sure we've connected to the read-write server is to wait
# until we're connected to both. Also, if we manage to connect to two
# servers this gives us some confidence that both the read-only and
# read-write servers are running.
if
len
(
connected
)
>=
2
:
print
(
print
(
"
Connected to a server:
\n
"
"
Connected to a server:
\n
"
"
\t
{nodeid}
\n
"
"
\t
{nodeid}
\n
"
...
...
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