- GitHub (even if mining Travis)
- Travis CI (only if mining Travis)
- Docker Hub
DOCKER_HUB_REPO- The DockerHub repository that will hold Docker Images pushed by the BugSwarm Reproducer. For examplebugswarm/images.DOCKER_HUB_CACHED_REPO- The DockerHub repository that will hold Docker Images pushed by the CacheDependencies step in the BugSwarm Reproducer. Leave this blank to skip caching dependencies. For examplebugswarm/cached-images.DOCKER_HUB_USERNAME- This is the username credential being used by the DockerHub API to access theDOCKER_HUB_REPO. For examplebugswarm.DOCKER_HUB_PASSWORD- This is the password credential being used by the DockerHub API to access theDOCKER_HUB_REPO. You can also use an access token instead.GITHUB_TOKENS- A GitHub Access Token to perform Git Operations over HTTPS via the Git API. The token only needs "public access", so it does not need any additional scopes in the "Select scopes" page. (used for Mining projects)TRAVIS_TOKENS- A Travis CI Access Token to send authenticated requests to Travis CI. (used for gathering builds)DATABASE_PIPELINE_TOKEN- The token of a user's account used to access MongoDB. ('testDBPassword' if using Docker image of Mongo)COMMON_HOSTNAME- This hostname is used to integrate the API usage with your local database. It should be<LOCAL-IPADDRESS>:5000, for example127.0.0.1:5000.
-
The GitHub tokens should look like this in
credentials.py:GITHUB_TOKENS = ['ghp_ABcdEfghijKLMNOPQrStUvwXyz0123456789']
-
You can verify the token using the following curl command:
curl -H 'Authorization: token ghp_ABcdEfghijKLMNOPQrStUvwXyz0123456789' https://api.github.com/repos/BugSwarm/bugswarm -
If you see
{"message": "Bad credentials ..., then the token is not valid. (Reference)
-
The Docker tokens should look like this in
credentials.py:DOCKER_HUB_REPO = 'YOUR_USER_NAME/REPO_1' DOCKER_HUB_CACHED_REPO = 'YOUR_USER_NAME/REPO_2' DOCKER_HUB_USERNAME = 'YOUR_USER_NAME' DOCKER_HUB_PASSWORD = '11223344-5566-7788-9900-aabbccddeeff'
-
You can verify the token using the docker client:
$ docker login # enter your username (YOUR_USER_NAME) # enter your password / token (11223344-5566-7788-9900-aabbccddeeff) $ docker pull ubuntu:20.04 $ docker tag ubuntu:20.04 YOUR_USER_NAME/REPO_1:docker_test_image $ docker tag ubuntu:20.04 YOUR_USER_NAME/REPO_2:docker_test_image $ docker push YOUR_USER_NAME/REPO_1:docker_test_image $ echo $? $ docker push YOUR_USER_NAME/REPO_2:docker_test_image $ echo $?
-
If one of the
echo $?gives a non-zero value, then the password / token is not valid.
-
The Travis tokens should look like this in
credentials.py:TRAVIS_TOKENS = ['1234567890A-bCdEfGhIjK']
-
You can verify the token using the following curl command:
curl -H "Travis-API-Version: 3" -H "Authorization: token 1234567890A-bCdEfGhIjK" https://api.travis-ci.com/repos
-
If you see
access denied, then the token is not valid. (Reference)
In the case where you modify your credentials under the common/credentials.py file, but ran the provision.sh
script previously, the BugSwarm package will still retain the old values. You would need to uninstall the package and
run the provision.sh script once more.
If you have an existing MongoDB instance running on your machine, it's most likely utilizing the default port 27017.
In the case where you would want to use our provided Dockerfile for the database you must change the port in a few spots.
For example, lets use port 27020 when running the Docker image of the database, the command would be:
docker run -it -p 27020:27017 -p 5000:5000 bugswarm-db (Note the change in the first -p argument)
So now when connecting to this instance of Mongo, the command would be:
mongosh --port 27020
In the case where the second -p argument for port 5000 is used, our BugSwarm pipeline API port, we can also map to a
different port as follows:
docker run -it -p 27017:27017 -p 5002:5000 bugswarm-db (Note the change in the second -p argument)
This port will now be set under the common/credentials.py file as:
COMMON_HOSTNAME=<LOCAL-IPADDRESS>:5002
If you have followed these steps, resume at #4 of Setting up BugSwarm
Docker is lightweight in comparison to Virtual Machines (VMs). The virtualization environment is interchangeable with VMs. In principle, Travis CI creates and retains a base Docker image which is the exact build environment.
MongoDB is an object-oriented, scalable and dynamic NoSQL database. The data is stored as JSON or BSON documents inside a collection. The use of high performance, availability, and scaling provides easy integration thus satisfying the BugSwarm needs.
-
Connect to the database
mongosh
-
Execute the following commands in Mongo Shell
> use bugswarm > db.accounts.find() > db.accounts.findAndModify({ ... query: { email: "pipeline.bugswarm@gmail.com", token: "testDBPassword" }, ... update: { $set: { token: "new-token" } } ... }) > db.accounts.find() > exit -
The new token will be
new-token. Be sure to updateDATABASE_PIPELINE_TOKENincommon/credentials.py.