From 7df9fc312d2870506e5fc0fa2ad631accbcb6e88 Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Thu, 15 Aug 2019 17:29:25 -0500 Subject: [PATCH] server: change dvc.org/s3 redirect to 'dvc-public' S3 bucket for #560 --- server.js | 9 ++++----- static/docs/commands-reference/import-url.md | 10 +++++----- static/docs/get-started/add-files.md | 2 +- static/docs/get-started/connect-code-and-data.md | 2 +- static/docs/get-started/example-pipeline.md | 4 ++-- static/docs/get-started/example-versioning.md | 4 ++-- static/docs/tutorial/define-ml-pipeline.md | 2 +- static/docs/user-guide/external-dependencies.md | 6 +++--- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/server.js b/server.js index 745afaeaab..af894657b8 100644 --- a/server.js +++ b/server.js @@ -35,7 +35,8 @@ app.prepare().then(() => { } else if (req.headers.host === 'remote.dvc.org') { res.writeHead(301, { Location: - 'https://s3-us-west-2.amazonaws.com/dvc-public/remote' + pathname + 'https://s3-us-west-2.amazonaws.com/dvc-public/remote/' + + pathname.substring(1) }) res.end() } else if (doc.test(pathname)) { @@ -54,7 +55,7 @@ app.prepare().then(() => { } else if (s3.test(pathname)) { res.writeHead(301, { Location: - 'https://s3-us-west-2.amazonaws.com/dvc-share/' + + 'https://s3-us-west-2.amazonaws.com/dvc-public/' + pathname.substring(4) }) res.end() @@ -62,9 +63,7 @@ app.prepare().then(() => { res.writeHead(301, { Location: 'https://s3-us-east-2.amazonaws.com/dvc-s3-repo/' + - pathname.substring(1, 4) + - '/' + - pathname.substring(5) + pathname.substring(1) }) res.end() } else if (chat.test(pathname)) { diff --git a/static/docs/commands-reference/import-url.md b/static/docs/commands-reference/import-url.md index b1e2db7562..cde14aaa6e 100644 --- a/static/docs/commands-reference/import-url.md +++ b/static/docs/commands-reference/import-url.md @@ -150,8 +150,8 @@ An advanced alternate to [Add Files](/doc/get-started/add-files) step of the _Get Started_ section is to use `dvc import-url`: ```dvc -$ dvc import-url https://dvc.org/s3/get-started/data.xml data/data.xml -Importing 'https://dvc.org/s3/get-started/data.xml' -> 'data/data.xml' +$ dvc import-url https://dvc.org/s3/data/get-started/data.xml data/data.xml +Importing 'https://dvc.org/s3/data/get-started/data.xml' -> 'data/data.xml' [##############################] 100% data.xml [##############################] 100% data.xml @@ -172,7 +172,7 @@ md5: 61e80c38c1ce04ed2e11e331258e6d0d wdir: . deps: - etag: '"f432e270cd634c51296ecd2bc2f5e752-5"' - path: https://dvc.org/s3/get-started/data.xml + path: https://dvc.org/s3/data/get-started/data.xml outs: - md5: a304afb96060aad90176268345e10355 path: data/data.xml @@ -210,7 +210,7 @@ life, the data file will probably be on a remote server.) Run these commands: ```dvc $ mkdir /tmp/dvc-import-url-example $ cd /tmp/dvc-import-url-example/ -$ wget https://dvc.org/s3/get-started/data.xml +$ wget https://dvc.org/s3/data/get-started/data.xml $ cd - # to go back to the project ``` @@ -252,7 +252,7 @@ Let's now manually reproduce _Get Started_ project. Download the sample source code archive and unzip it: ```dvc -$ wget https://dvc.org/s3/get-started/code.zip +$ wget https://dvc.org/s3/code/get-started/code.zip $ unzip code.zip $ rm -f code.zip ``` diff --git a/static/docs/get-started/add-files.md b/static/docs/get-started/add-files.md index b09af1c6a7..d2f9f01941 100644 --- a/static/docs/get-started/add-files.md +++ b/static/docs/get-started/add-files.md @@ -6,7 +6,7 @@ Let's get a sample dataset to play with: ```dvc $ mkdir data -$ wget https://dvc.org/s3/get-started/data.xml -O data/data.xml +$ wget https://dvc.org/s3/data/get-started/data.xml -O data/data.xml ```
diff --git a/static/docs/get-started/connect-code-and-data.md b/static/docs/get-started/connect-code-and-data.md index 8867b0417c..7eef72c7f9 100644 --- a/static/docs/get-started/connect-code-and-data.md +++ b/static/docs/get-started/connect-code-and-data.md @@ -12,7 +12,7 @@ to get the sample code: > On Windows just use your browser to download the archive instead. ```dvc -$ wget https://dvc.org/s3/get-started/code.zip +$ wget https://dvc.org/s3/code/get-started/code.zip $ unzip code.zip $ rm -f code.zip ``` diff --git a/static/docs/get-started/example-pipeline.md b/static/docs/get-started/example-pipeline.md index 9515c9e726..0afd91e1d6 100644 --- a/static/docs/get-started/example-pipeline.md +++ b/static/docs/get-started/example-pipeline.md @@ -38,7 +38,7 @@ your browser to download `code.zip`. ```dvc $ mkdir example && cd example $ git init -$ wget https://dvc.org/s3/examples/so/code.zip +$ wget https://dvc.org/s3/code/tutorial-nlp/code.zip $ unzip code.zip $ rm -f code.zip $ git add code/ @@ -80,7 +80,7 @@ control: ```dvc $ mkdir data -$ wget -P data https://dvc.org/s3/examples/so/Posts.xml.zip +$ wget -P data https://dvc.org/s3/data/tutorial-nlp/10K/Posts.xml.zip $ dvc add data/Posts.xml.zip ``` diff --git a/static/docs/get-started/example-versioning.md b/static/docs/get-started/example-versioning.md index bbd3296d20..3679f6f072 100644 --- a/static/docs/get-started/example-versioning.md +++ b/static/docs/get-started/example-versioning.md @@ -92,7 +92,7 @@ right-click [this link](/s3/examples/versioning/data.zip) and click
```dvc -$ wget https://dvc.org/s3/examples/versioning/data.zip +$ wget https://dvc.org/s3/data/tutorial-ver/data.zip $ unzip data.zip $ rm -f data.zip ``` @@ -182,7 +182,7 @@ Let's imagine that our images dataset is growing, we were able to double it. Next command extracts 500 cat and 500 dog images into `data/train`: ```dvc -$ wget https://dvc.org/s3/examples/versioning/new-labels.zip +$ wget https://dvc.org/s3/data/tutorial-ver/new-labels.zip $ unzip new-labels.zip $ rm -f new-labels.zip ``` diff --git a/static/docs/tutorial/define-ml-pipeline.md b/static/docs/tutorial/define-ml-pipeline.md index d91e5a6176..cb56094d68 100644 --- a/static/docs/tutorial/define-ml-pipeline.md +++ b/static/docs/tutorial/define-ml-pipeline.md @@ -17,7 +17,7 @@ to download `data.xml`and save it into the `data` subdirectory. ```dvc $ mkdir data -$ wget -P data https://dvc.org/s3/so/100K/Posts.xml.zip +$ wget -P data https://dvc.org/s3/data/tutorial-nlp/100K/Posts.xml.zip $ du -sh data/* 41M data/Posts.xml.zip ``` diff --git a/static/docs/user-guide/external-dependencies.md b/static/docs/user-guide/external-dependencies.md index 0ea0fe756a..2f7da87d32 100644 --- a/static/docs/user-guide/external-dependencies.md +++ b/static/docs/user-guide/external-dependencies.md @@ -113,8 +113,8 @@ In the previous examples, downloading commands were used: `aws s3 cp`, `scp`, types of dependencies. ```dvc -$ dvc import-url https://dvc.org/s3/get-started/data.xml -Importing 'https://dvc.org/s3/get-started/data.xml' -> 'data.xml' +$ dvc import-url https://dvc.org/s3/data/get-started/data.xml +Importing 'https://dvc.org/s3/data/get-started/data.xml' -> 'data.xml' [##############################] 100% data.xml ... ``` @@ -130,7 +130,7 @@ The command above creates an import stage specified in DVC-file # ... deps: - etag: '"f432e270cd634c51296ecd2bc2f5e752-5"' - path: https://dvc.org/s3/get-started/data.xml + path: https://dvc.org/s3/data/get-started/data.xml outs: - md5: a304afb96060aad90176268345e10355 path: data.xml