Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123025
D1242.id3924.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D1242.id3924.diff
View Options
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,14 +1,16 @@
# SWH Tarball Loader
-The Software Heritage Tarball Loader is in charge of ingesting the
-directory representation of the tarball into the Software Heritage
-archive.
+The Software Heritage Tarball Loader is in charge of ingesting the directory
+representation of the tarball into the Software Heritage archive.
-## Configuration
+## Sample configuration
-This is the loader's (or task's) configuration file.
+The loader's configuration will be taken from the default configuration file:
+`~/.config/swh/loader/tar.yml` (you can choose a different path by setting the
+`SWH_CONFIG_FILENAME` environment variable).
-*`{/etc/softwareheritage | ~/.config/swh | ~/.swh}`/loader/tar.yml*:
+This file holds information for the loader to work, including celery
+configuration:
```YAML
working_dir: /home/storage/tmp/
@@ -16,11 +18,14 @@
cls: remote
args:
url: http://localhost:5002/
+celery:
+task_modules:
+ - swh.loader.tar.tasks
+task_queues:
+ - swh.loader.tar.tasks.LoadTarRepository
```
-## API
-
-### local
+### Local
Load local tarball directly from code or python3's toplevel:
@@ -34,15 +39,14 @@
import logging
logging.basicConfig(level=logging.DEBUG)
-from swh.loader.tar.tasks import LoadTarRepository
-l = LoadTarRepository()
-l.run_task(origin=origin, visit_date=visit_date,
- last_modified=last_modified)
+from swh.loader.tar.tasks import load_tar
+load_tar(origin=origin, visit_date=visit_date,
+ last_modified=last_modified)
```
-### remote
+### Remote
-Load remote tarball is the same sample
+Load remote tarball is the same sample:
```Python
url = 'https://ftp.gnu.org/gnu/8sync/8sync-0.1.0.tar.gz'
@@ -52,8 +56,7 @@
import logging
logging.basicConfig(level=logging.DEBUG)
-from swh.loader.tar.tasks import LoadTarRepository
-l = LoadTarRepository()
-l.run_task(origin=origin, visit_date=visit_date,
- last_modified=last_modified)
+from swh.loader.tar.tasks import load_tar
+load_tar(origin=origin, visit_date=visit_date,
+ last_modified=last_modified)
```
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 4:15 PM (2 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219655
Attached To
D1242: README: update loading instructions (now using celery task)
Event Timeline
Log In to Comment