Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor libp2p with gx #2256

Merged
merged 30 commits into from
Feb 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0e312f5
initial vendoring of libp2p outside of the repo with gx
whyrusleeping Jan 27, 2016
e12a56d
package.json cleanup
whyrusleeping Jan 27, 2016
3b784b5
add makefile rule for grabbing gx and deps
whyrusleeping Jan 27, 2016
3d0aa59
go-keyspace dep from libp2p added
whyrusleeping Jan 28, 2016
0e8a670
correct go-log dep
whyrusleeping Jan 28, 2016
0dba051
add better makefile and reference gx stuff in readme
whyrusleeping Jan 28, 2016
1f1c52c
go go circle tests!
whyrusleeping Jan 28, 2016
b16c0ce
circle.yml fix?
whyrusleeping Jan 29, 2016
9c05a0d
verbose gx install
whyrusleeping Jan 30, 2016
b5a93ea
gx install stuff in cmd/ipfs/Makefile
whyrusleeping Jan 30, 2016
b96c2e6
circleci verbose
whyrusleeping Jan 30, 2016
d141589
travis file change
whyrusleeping Jan 30, 2016
1b6e426
circleci fun fun fun
whyrusleeping Jan 30, 2016
bf3ad94
i'm beginning to dislike circleci
whyrusleeping Jan 30, 2016
ed3841f
on a scale from 1 to annoying, i don't like circleCI anymore at all
whyrusleeping Jan 30, 2016
89bb338
ciiiii issss awesome
whyrusleeping Jan 30, 2016
57c6e1e
circleci has bad documentation
whyrusleeping Jan 31, 2016
49ae649
lets not have any documentation for this stupid file format, its awesome
whyrusleeping Jan 31, 2016
c900a1e
also, yaml is a terrible format
whyrusleeping Jan 31, 2016
4012c6b
documentation saves lives
whyrusleeping Jan 31, 2016
c0101c0
update libp2p dep
whyrusleeping Jan 31, 2016
2263539
do that last thing again
whyrusleeping Jan 31, 2016
81c8cff
Rework the Dockerfile
Feb 4, 2016
c103efc
sharness: disable t0300-docker-image on Circle CI
Feb 5, 2016
ce0d62d
docker: save image space by excluding .git/
Feb 5, 2016
9ade210
Cleaned up README
RichardLitt Feb 5, 2016
ffc4831
Merge pull request #2302 from ipfs/feature/gx-libp2p-readme-edits
whyrusleeping Feb 5, 2016
c9b83c5
makefile fixes
whyrusleeping Feb 5, 2016
5c5ad7a
note in assets test
whyrusleeping Feb 6, 2016
3373138
add deps target to nofuse
whyrusleeping Feb 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.git
.git/
!.git/HEAD
!.git/refs/
cmd/ipfs/ipfs
vendor/gx/
test/
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ env:
- TEST_NO_FUSE=1 TEST_VERBOSE=1 TEST_SUITE=test_go_expensive
- TEST_NO_FUSE=1 TEST_VERBOSE=1 TEST_SUITE=test_sharness_expensive

install: make install

script:
- make $TEST_SUITE

Expand Down
91 changes: 68 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,79 @@
FROM alpine:3.3
MAINTAINER Brian Tiger Chow <btc@perfmode.com>
MAINTAINER Lars Gierth <lgierth@ipfs.io>

# There is a copy of this Dockerfile in test/sharness,
# which is optimized for build time, instead of image size.
#
# Please keep these two Dockerfiles in sync.

ENV IPFS_PATH /data/ipfs
ENV GOPATH /go:/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace

EXPOSE 4001 5001 8080
# 4001 = Swarm, 5001 = API, 8080 = HTTP transport
# Ports for Swarm TCP, Swarm uTP, API, Gateway
EXPOSE 4001
EXPOSE 4002/udp
EXPOSE 5001
EXPOSE 8080

ADD bin/container_daemon /usr/local/bin/start_ipfs
ADD bin/container_shacheck /usr/local/bin/shacheck
# Volume for mounting an IPFS fs-repo
# This is moved to the bottom for technical reasons.
#VOLUME $IPFS_PATH

ADD . /go/src/github.com/ipfs/go-ipfs
WORKDIR /go/src/github.com/ipfs/go-ipfs/cmd/ipfs
# IPFS API to use for fetching gx packages.
# This can be a gateway too, since its read-only API provides all gx needs.
# - e.g. /ip4/172.17.0.1/tcp/8080 if the Docker host
# has the IPFS gateway listening on the bridge interface
# provided by Docker's default networking.
# - if empty, the public gateway at ipfs.io is used.
ENV GX_IPFS ""
# The IPFS fs-repo within the container
ENV IPFS_PATH /data/ipfs
# Golang stuff
ENV GO_VERSION 1.5.3-r0
ENV GOPATH /go
ENV PATH /go/bin:$PATH
ENV SRC_PATH /go/src/github.com/ipfs/go-ipfs

RUN adduser -D -h /data -u 1000 ipfs \
&& mkdir -p /data/ipfs && chown ipfs:ipfs /data/ipfs \
&& apk add --update bash ca-certificates git go \
&& go install -ldflags "-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=$(git rev-parse --short HEAD 2> /dev/null || echo unknown)" \
&& mv /go/bin/ipfs /usr/local/bin/ipfs \
&& chmod 755 /usr/local/bin/start_ipfs \
&& apk del --purge go git
# Get the go-ipfs sourcecode
COPY . $SRC_PATH

WORKDIR /
RUN rm -rf /go/src/github.com/ipfs/go-ipfs
RUN apk add --update musl go=$GO_VERSION git bash wget ca-certificates \
# Setup user and fs-repo directory
&& mkdir -p $IPFS_PATH \
&& adduser -D -h $IPFS_PATH -u 1000 ipfs \
&& chown ipfs:ipfs $IPFS_PATH && chmod 755 $IPFS_PATH \
# Install gx
&& go get -u github.com/whyrusleeping/gx \
&& go get -u github.com/whyrusleeping/gx-go \
# Point gx to a specific IPFS API
&& ([ -z "$GX_IPFS" ] || echo $GX_IPFS > $IPFS_PATH/api) \
# Invoke gx
&& cd $SRC_PATH \
&& gx --verbose install --global \
# We get the current commit using this hack,
# so that we don't have to copy all of .git/ into the build context.
# This saves us quite a bit of image size.
&& ref="$(cat .git/HEAD | cut -d' ' -f2)" \
&& commit="$(cat .git/$ref | head -c 7)" \
&& echo "ldflags=-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=$commit" \
# Build and install IPFS and entrypoint script
&& cd $SRC_PATH/cmd/ipfs \
&& go build -ldflags "-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=$commit" \
&& cp ipfs /usr/local/bin/ipfs \
&& cp $SRC_PATH/bin/container_daemon /usr/local/bin/start_ipfs \
&& chmod 755 /usr/local/bin/start_ipfs \
# Remove all build-time dependencies
&& apk del --purge musl go git && rm -rf $GOPATH && rm -vf $IPFS_PATH/api

# Call uid 1000 "ipfs"
USER ipfs
VOLUME /data/ipfs

ENTRYPOINT ["/usr/local/bin/start_ipfs"]
# Expose the fs-repo as a volume.
# We're doing this down here (and not at the top),
# so that the overlay directory is owned by the ipfs user.
# start_ipfs initializes an ephemeral fs-repo if none is mounted,
# which is why uid=1000 needs write permissions there.
VOLUME $IPFS_PATH

# build: docker build -t go-ipfs .
# run: docker run -p 4001:4001 -p 5001:5001 go-ipfs:latest
# run: docker run -p 8080:8080 -p 4001:4001 -p 5001:5001 go-ipfs:latest
# This just makes sure that:
# 1. There's an fs-repo, and initializes one if there isn't.
# 2. The API and Gateway are accessible from outside the container.
ENTRYPOINT ["/usr/local/bin/start_ipfs"]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Godeps/_workspace/src/bazil.org/fuse/fs/serve.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Godeps/_workspace/src/bazil.org/fuse/fs/serve_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Godeps/_workspace/src/bazil.org/fuse/fs/tree.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Godeps/_workspace/src/bazil.org/fuse/hellofs/hello.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Godeps/_workspace/src/bazil.org/fuse/options_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Godeps/_workspace/src/github.com/anacrolix/utp/utp_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading