Skip to content

Commit

Permalink
Modifying Dockerfile to build bittensor from repository version and n…
Browse files Browse the repository at this point in the history
…ot from github (#1016)

* Modifying Dockerfile to build bittensor from repository version and not git clone the github repo. Updating version to 3.5.1

* CircleCI check to check that version was updated

* CircleCI check to check that version was updated

* CircleCI check to check that version was updated

* CircleCI check to check that version was updated

* CircleCI check to check that version was updated
  • Loading branch information
eduardogr committed Nov 25, 2022
1 parent 6651779 commit d532ad5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ jobs:
pip3 install --upgrade coveralls
coveralls --finish --rcfile .coveragerc || echo "Failed to upload coverage"
check-version-updated:
docker:
- image: cimg/python:3.10
steps:
- checkout

- run:
name: Version is updated
command: |
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..master | grep bittensor/__init__.py | wc -l) == 1 ]] && echo "bittensor/__init__.py has changed"
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..master | grep VERSION | wc -l) == 1 ]] && echo "VERSION has changed"
workflows:
pre-pr:
jobs:
Expand All @@ -123,3 +135,11 @@ workflows:
#- coveralls:
#requires:
#- build-and-test

check-version-updated:
jobs:
- check-version-updated:
filters:
branches:
only:
- /^(release|hotfix)/.*/
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
*.log
*.png
*.pstats

**/bittensor.egg-info/*
**/lib/*
**/build/*
**/dist/*
**/runs/*
**/env/*
**/venv/*
./circleci/*
./github/*
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ RUN bash -c "source $HOME/.nvm/nvm.sh && \
npm install --location=global pm2"

RUN mkdir -p /root/.bittensor/
RUN cd /root/.bittensor/ && \
git clone https://github.com/opentensor/bittensor.git bittensor && \
python3 -m pip install -e bittensor
COPY . /root/.bittensor/
RUN cd /root/.bittensor/ && python3 -m pip install .

# Increase ulimit to 1,000,000
RUN prlimit --pid=$PPID --nofile=1000000
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0
3.5.1
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = '3.5.0'
__version__ = '3.5.1'
version_split = __version__.split(".")
__version_as_int__ = (100 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))

Expand Down
2 changes: 1 addition & 1 deletion scripts/release/release_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fi
# 4. Uploading docker image
if [[ $APPLY == "true" ]]; then
echo_info "Pushing docker image"
sudo docker push $DOCKER_IMAGE_NAME
sudo docker push $DOCKER_IMAGE_NAME
else
echo_warning "Dry run execution. Not pushing docker image '$DOCKER_IMAGE_NAME'"
fi

0 comments on commit d532ad5

Please sign in to comment.