Skip to content

Commit

Permalink
remove the fallback to bandersnatch mirror (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft committed Jun 28, 2023
1 parent 0c84900 commit 82ac3a3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 48 deletions.
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

0 comments on commit 82ac3a3

Please sign in to comment.