Skip to content

Commit

Permalink
server: change dvc.org/s3 redirect to 'dvc-public' S3 bucket
Browse files Browse the repository at this point in the history
for #560
  • Loading branch information
jorgeorpinel committed Aug 15, 2019
1 parent 82eb999 commit 7df9fc3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
9 changes: 4 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -54,17 +55,15 @@ 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()
} else if (pkg.test(pathname)) {
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)) {
Expand Down
10 changes: 5 additions & 5 deletions static/docs/commands-reference/import-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion static/docs/get-started/add-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

<details>
Expand Down
2 changes: 1 addition & 1 deletion static/docs/get-started/connect-code-and-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions static/docs/get-started/example-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions static/docs/get-started/example-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ right-click [this link](/s3/examples/versioning/data.zip) and click
</details>

```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
```
Expand Down Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion static/docs/tutorial/define-ml-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
6 changes: 3 additions & 3 deletions static/docs/user-guide/external-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
```
Expand All @@ -130,7 +130,7 @@ The command above creates an <abbr>import stage</abbr> 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
Expand Down

0 comments on commit 7df9fc3

Please sign in to comment.