Skip to content
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

remove the fallback to bandersnatch mirror #143

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion terraform/file-hosting/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ variable "domain" { type = string }
variable "fastly_service_name" { type = string }
variable "conveyor_address" { type = string }
variable "files_bucket" { type = string }
variable "mirror" { type = string }
variable "linehaul_enabled" { type = bool }
variable "linehaul_gcs" { type = map(any) }
variable "s3_logging_keys" { type = map(any) }
Expand Down
6 changes: 1 addition & 5 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module "pypi" {
# Note: the first domain in "extra_domains" gets an XMLRPC exception/bypass in VCL
extra_domains = ["pypi.python.org", "www.pypi.org", "pypi.io", "www.pypi.io", "warehouse.python.org"]
backend = "warehouse.cmh1.psfhosted.org"
mirror = "mirror.dub1.pypi.io"
s3_logging_keys = var.fastly_s3_logging

warehouse_token = var.warehouse_token
Expand All @@ -122,9 +121,8 @@ module "test-pypi" {
# Note: the first domain in "extra_domains" gets an XMLRPC exception/bypass in VCL
extra_domains = ["testpypi.python.org", "test.pypi.io", "warehouse-staging.python.org"]
backend = "warehouse-test.ingress.cmh1.psfhosted.org"
mirror = "test-mirror.dub1.pypi.io"
s3_logging_keys = var.fastly_s3_logging

warehouse_token = var.test_pypi_warehouse_token
warehouse_ip_salt = var.warehouse_ip_salt

Expand All @@ -147,7 +145,6 @@ module "file-hosting" {
fastly_service_name = "PyPI File Hosting"
conveyor_address = "conveyor.cmh1.psfhosted.org"
files_bucket = "pypi-files"
mirror = "mirror.dub1.pypi.io"
s3_logging_keys = var.fastly_s3_logging
datadog_token = var.datadog_token

Expand Down Expand Up @@ -176,7 +173,6 @@ module "test-file-hosting" {
fastly_service_name = "Test PyPI File Hosting"
conveyor_address = "conveyor-test.ingress.cmh1.psfhosted.org"
files_bucket = "pypi-files-staging"
mirror = "test-mirror.dub1.pypi.io"
s3_logging_keys = var.fastly_s3_logging
datadog_token = var.datadog_token

Expand Down
42 changes: 0 additions & 42 deletions terraform/warehouse/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ variable "zone_id" { type = string }
variable "domain" { type = string }
variable "extra_domains" { type = list(any) }
variable "backend" { type = string }
variable "mirror" { type = string }
variable "s3_logging_keys" { type = map(any) }
variable "linehaul_enabled" { type = bool }
variable "linehaul_gcs" { type = map(any) }
Expand Down Expand Up @@ -78,26 +77,6 @@ resource "fastly_service_vcl" "pypi" {
error_threshold = 5
}

backend {
name = "Mirror"
auto_loadbalance = false
shield = "london_city-uk"

request_condition = "Primary Failure (Mirror-able)"
healthcheck = "Mirror Health"

address = var.mirror
port = 443
use_ssl = true
ssl_cert_hostname = var.mirror
ssl_sni_hostname = var.mirror

connect_timeout = 5000
first_byte_timeout = 60000
between_bytes_timeout = 15000
error_threshold = 5
}

healthcheck {
name = "Application Health"

Expand All @@ -112,20 +91,6 @@ resource "fastly_service_vcl" "pypi" {
window = 4
}

healthcheck {
name = "Mirror Health"

host = var.domain
method = "GET"
path = "/last-modified"

check_interval = 3000
timeout = 2000
threshold = 2
initial = 2
window = 4
}

dictionary {
name = "masked_ip_blocklist"
}
Expand Down Expand Up @@ -214,13 +179,6 @@ resource "fastly_service_vcl" "pypi" {
content_type = "text/plain"
}

condition {
name = "Primary Failure (Mirror-able)"
type = "REQUEST"
statement = "(!req.backend.healthy || req.restarts > 0) && (req.url ~ \"^/simple/\" || req.url ~ \"^/pypi/[^/]+(/[^/]+)?/json$\")"
priority = 1
}

condition {
name = "5xx Error"
type = "RESPONSE"
Expand Down