You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the [README](https://github.com/clowder-framework/pyclowder/tree/master/sample-extractors/wordcount#readme) in `sample-extractors/wordcount`. Using Docker, no install is required.
37
+
35
38
## Example Extractor
36
39
37
40
Following is an example of the WordCount extractor. This example will allow the user to specify from the command line
Copy file name to clipboardExpand all lines: sample-extractors/wordcount/README.md
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,42 @@ A simple extractor that counts the number of characters, words and lines in a te
2
2
3
3
# Docker
4
4
5
-
This extractor is ready to be run as a docker container. To build the docker container run:
5
+
This extractor is ready to be run as a docker container, the only dependency is a running Clowder instance. Simply build and run.
6
+
7
+
1. Start Clowder. For help starting Clowder, see our [getting started guide](https://github.com/clowder-framework/clowder/blob/develop/doc/src/sphinx/userguide/installing_clowder.rst).
8
+
9
+
2. First build the extractor Docker container:
6
10
7
11
```
12
+
# from this directory, run:
13
+
8
14
docker build -t clowder_wordcount .
9
15
```
10
16
11
-
To run the docker containers use:
17
+
3. Finally run the extractor:
12
18
13
19
```
14
-
docker run -t -i --rm -e "RABBITMQ_URI=amqp://rabbitmqserver/clowder" clowder_wordcount
15
-
docker run -t -i --rm --link clowder_rabbitmq_1:rabbitmq clowder_wordcount
The RABBITMQ_URI and RABBITMQ_EXCHANGE environment variables can be used to control what RabbitMQ server and exchange it will bind itself to, you can also use the --link option to link the extractor to a RabbitMQ container.
23
+
Then open the Clowder web app and run the wordcount extractor on a .txt file (or similar)! Done.
24
+
25
+
### Python and Docker details
26
+
27
+
You may use any version of Python 3. Simply edit the first line of the `Dockerfile`, by default it uses `FROM python:3.8`.
28
+
29
+
Docker flags:
30
+
31
+
-`--net` links the extractor to the Clowder Docker network (run `docker network ls` to identify your own.)
32
+
-`-e RABBITMQ_URI=` sets the environment variables can be used to control what RabbitMQ server and exchange it will bind itself to. Setting the `RABBITMQ_EXCHANGE` may also help.
33
+
- You can also use `--link` to link the extractor to a RabbitMQ container.
34
+
-`--name` assigns the container a name visible in Docker Desktop.
35
+
36
+
## Troubleshooting
37
+
38
+
**If you run into _any_ trouble**, please reach out on our Clowder Slack in the [#pyclowder channel](https://clowder-software.slack.com/archives/CNC2UVBCP).
39
+
40
+
Alternate methods of running extractors are below.
0 commit comments