Skip to content

Commit

Permalink
update project structure to allow for more example repos
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeorpinel committed Aug 13, 2019
1 parent 369d70f commit 5bfa3ac
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 68 deletions.
61 changes: 5 additions & 56 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Custom
*.zip
/tmp


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -36,51 +38,14 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
Expand All @@ -89,19 +54,3 @@ venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

*.zip
/tmp
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Get Started Tutorial (sources)

Contains source code, deployment and generation scripts for the
[get started](https://dvc.org/doc/get-started) tutorial.
Contains source code, deployment and generation scripts for example DVC
repositories used in the [Get Started](https://dvc.org/doc/get-started) and
other sections of the docs.

- `create.sh` - generates the `example-get-started` repository. The previous
version must be manually deleted on Github. Code bundle is downloaded from
S3 the same way as in the online tutorial. If you update code, make sure
to run `deploy.sh` first to make sure that the archive is up to date.
- `deploy.sh` - deploys code archive that is downloaded as part of the tutorial
to S3.
- `get-started.sh` - generates the `example-get-started` DVC project from
scratch. Code bundle is downloaded from S3 the same way as in the _Get
Started_ -> [Connect Code and
Data](https://dvc.org/doc/get-started/connect-code-and-data) chapter.

If you change [source code](code/src/) files, run `deploy.sh` first to make
sure that the code.zip archive is up to date.

- `deploy.sh` - deploys code archive that is downloaded as part of the
`get-started.sh` to S3.
> Requires AWS CLI and write access to `dvc-share` S3 bucket.
5 changes: 3 additions & 2 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# DVC Get Started

This is an auto-generated repository (please, don't create issues here, use the
[example-get-started-dev](https://github.com/iterative/example-get-started-dev)).
This is an auto-generated repository for use in https://dvc.org/doc/get-started.
Please report any issues in
[example-repos-dev](https://github.com/iterative/example-repos-dev).

![](https://dvc.org/static/img/example-flow-2x.png)

Expand Down
8 changes: 6 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

set -uvex
# e Exit immediately if a command exits with a non-zero exit status.
# u Treat unset variables as an error when substituting.
# v Print shell input lines as they are read.
# x Print commands and their arguments as they are executed.
set -euvx

PACKAGE_DIR=code
PACKAGE=code.zip
Expand All @@ -15,7 +19,7 @@ pushd $PACKAGE_DIR
zip -r $PACKAGE src/* requirements.txt
popd


# Requires AWS CLI and write access to `dvc-share` S3 bucket.
mv $PACKAGE_DIR/$PACKAGE .
aws s3 cp --acl public-read $PACKAGE s3://dvc-share/get-started/$PACKAGE

Expand Down
4 changes: 4 additions & 0 deletions create.sh → get-started.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# e Exit immediately if a command exits with a non-zero exit status.
# u Treat unset variables as an error when substituting.
# v Print shell input lines as they are read.
# x Print commands and their arguments as they are executed.
set -euvx

THIS="$( cd "$(dirname "$0")" ; pwd -P )"
Expand Down

0 comments on commit 5bfa3ac

Please sign in to comment.