-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust staging environment configuration #17
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -60,6 +60,28 @@ public static void Main(string[] args) | |||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
case "Staging": | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
builder.Services.AddSingleton<IBeatmapStorage, LocalBeatmapStorage>(); | ||||||||||||||||||||||||||||
builder.Services.AddTransient<BeatmapPackagePatcher>(); | ||||||||||||||||||||||||||||
builder.Services.AddHttpClient(); | ||||||||||||||||||||||||||||
builder.Services.AddTransient<ILegacyIO, LegacyIO>(); | ||||||||||||||||||||||||||||
builder.Services.AddTransient<IMirrorService, NoOpMirrorService>(); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (AppSettings.SentryDsn == null) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
throw new InvalidOperationException("SENTRY_DSN environment variable not set. " | ||||||||||||||||||||||||||||
+ "Please set the value of this variable to a valid Sentry DSN to use for logging events."); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (AppSettings.DatadogAgentHost == null) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
throw new InvalidOperationException("DD_AGENT_HOST environment variable not set. " | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use ddog on staging 💸 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Roger, made optional in 8d398e1. Note that after that, if the envvar is not set, ddog will not be set up: osu-server-beatmap-submission/osu.Server.BeatmapSubmission/Program.cs Lines 116 to 128 in 82190f3
|
||||||||||||||||||||||||||||
+ "Please set the value of this variable to a valid hostname of a Datadog agent."); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
break; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
case "Production": | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
builder.Services.AddSingleton<IBeatmapStorage, S3BeatmapStorage>(); | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This turns off purge requests to beatmap mirrors - see implementation:
osu-server-beatmap-submission/osu.Server.BeatmapSubmission/Services/MirrorService.cs
Line 27 in 82190f3
Wasn't sure whether it was fine to keep this from production config or not, so I turned it off. Whether that is a valid setup depends on how the beatmap mirror setup is going to work. If the local beatmap storage is going to use the mirror's cache directory as the storage path, then this is required to make that setup work; otherwise, it depends on the specifics of how the mirror is going to function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I think it's better if applications have a single deployment config for consistency with everything else. More env vars can be used for further tuning (eg. turn off purging).
I'm not sure if a variable to turn off purging is required though, as that should never happen when using local storage (as that would always be a single shared volume), right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not completely sure what "single shared volume" you're referring to there... Maybe I'll elaborate further on the logic here:
The purge operation on the beatmap mirror removes the .osz from the
beatmapCache
folder in the mirror folder structure (see https://github.com/peppy/osu-web-10/blob/00da7635a49a0edb7048a2ed924d726c5b8a7e56/www/web/d.php#L60-L68). Now if that cache folder is independent from whatever the primary/master beatmap storage is (which is S3 in production), then it's whatever, that call can be executed no problem, nothing needs to be disabled.However, if for whatever reason (convenience, storage savings) the primary/master beatmap storage is symlinked/aliased/the same location as the beatmap cache, then the purge logic must be disabled, because every map would just get deleted from master after it's uploaded.
It's all a question of how you'd see the mirror functioning on staging I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no S3 in staging. How would the beatmap mirror retrieve the osz file if it's not in the same volume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes well that is the question here kinda isn't it 😅
There are three options I can think of:
d.php
on the staging mirror so that it just serves beatmaps fromosu-server-beatmap-submission
's local storage every time and delete all of the caching logic. In that case the purge calls will become no-ops on the mirror side, so they may as well stay.d.php
just for staging so that it can hitosu-server-beatmap-submission
's local storage for the .osz rather than s3, and copy it from there instead of downloading it from s3. In that case the purge calls can stay, but there's a bit of a hitch in that there are now potentially 2 copies of the .osz on staging. Maybe fine, maybe not.www/beatmapCache
of the mirror be the same directory asosu-server-beatmap-submission
's local storage via mounting / symlinking / whatever. The local beatmap storage has a file structure compatible with the beatmap cache's, so if you can point bothosu-server-beatmap-submission
's local storage and the beatmap mirror's cache at the same directory, things will just work without copying. But if you do that, then the purging logic has to be turned off for reasons described above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a think about this.