-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to start IPFS daemon with Docker
- Loading branch information
1 parent
cab4cd0
commit 08e6ba2
Showing
7 changed files
with
65 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ipfs/go-ipfs:v0.8.0 | ||
|
||
RUN sed -i 's/exec ipfs "$@"//' /usr/local/bin/start_ipfs | ||
ADD entrypoint.sh / | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["ipfs", "daemon", "--migrate=true", "--enable-namesys-pubsub"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,43 @@ | ||
|
||
# Local IPFS Server | ||
# Running Tests | ||
|
||
`py-ipfs-httpclient` requires a live local server to run its | ||
functional tests. | ||
Tests are primarily run from the command line using a locally installed IPFS server. | ||
|
||
## Installation | ||
Alternatively, you can launch the IPFS daemon with Docker and run tests from your IDE. | ||
|
||
To install it, follow the [official instructions](https://docs.ipfs.io/install/command-line/), | ||
then finish with some [local configuration](configure.sh): | ||
|
||
$ ./configure.sh | ||
## Local IPFS Server Installation | ||
|
||
The above script is run once after installing. | ||
To install it, follow the [official instructions](https://docs.ipfs.io/install/command-line/). | ||
|
||
## Running Tests | ||
Remaining configuration is applied by [run_tests.py](../../test/run-tests.py) on each run. | ||
|
||
|
||
## Running Tests Using Local Installation From Command Line | ||
|
||
* `tox -e py3` | ||
* `tox -e py3-httpx` | ||
|
||
|
||
## Running Tests Using Docker from IDE (e.g. PyCharm) | ||
|
||
1. Start [daemon.sh](daemon.sh) | ||
2. Run `pytest` tests from your IDE as your normally would | ||
|
||
You can keep the Docker container running across multiple | ||
executions of the functional test suite. | ||
|
||
|
||
## Running Tests Without Live Server | ||
|
||
You can run unit tests without a live server; `pytest` will skip | ||
over the functional tests when our fixtures detect the server | ||
isn't running. | ||
|
||
In a separate terminal, start IPFS with: | ||
|
||
$ ./run.sh | ||
## pytest-docker Plugin | ||
|
||
While `pytest-docker` supports running functional tests against a | ||
Docker container using Docker Compose, it is not supported on | ||
Windows or Mac with Travis and IPFS. | ||
|
||
Stop it with Ctrl+C. You can keep it running across multiple | ||
executions of the functional test suite. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
tag=py-ipfs-http-client-daemon:latest | ||
|
||
docker build -t $tag . | ||
docker run --rm -p 4001:4001 -p 5001:5001 -p 8080:8080 $tag | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Only does configuration; doesn't start the daemon | ||
/usr/local/bin/start_ipfs | ||
|
||
echo "Enabling experimental features" | ||
|
||
ipfs config --json Experimental.FilestoreEnabled true | ||
|
||
echo "Enabled experimental features" | ||
|
||
# Start the daemon (unless other args provided) | ||
exec "$@" |
This file was deleted.
Oops, something went wrong.