Skip to content

Instantly share code, notes, and snippets.

@bollwyvl
Last active May 8, 2020 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bollwyvl/c0c29ccb20dcf935a357526a91298e77 to your computer and use it in GitHub Desktop.
Save bollwyvl/c0c29ccb20dcf935a357526a91298e77 to your computer and use it in GitHub Desktop.

conda-ipfs

Binder

What can IPFS do for conda(-forge) now?

  • provide decentralized distribution of conda packages and metadata

How would this work?

  • on a periodic basis (say, hourly) conda-forge could

What could do more?

  • if conda packages were exploded at rest, similar to how they are stored in the pkgs directory...
    • they would be automatically deduplicated at the block level, such that incremental updates to a channel would be
name: conda-ipfs
commands:
lab:
unix: jupyter lab --no-browser --debug
build:
unix: conda-build -c conda-forge recipe --output-folder build/conda-bld
env_specs:
conda-ipfs:
channels:
- conda-forge
packages:
- conda
- conda-build=3.16
- ipywidgets
- jupyter-server-proxy
- jupyterlab >2.1,<3
- nodejs
#!/usr/bin/env bash
set -eux
CGO_ENABLED=1
make build GOTAGS=openssl
mkdir -p $PREFIX/bin
cp cmd/ipfs/ipfs $PREFIX/bin/ipfs
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
name: conda-ipfs
channels:
- conda-forge
dependencies:
- conda
- conda-build=3.16 # weird binary detection issues in later issues
- ipywidgets
- jupyter-server-proxy
- jupyterlab >2.1,<3
- nodejs
@jupyter-widgets/jupyterlab-manager
@jupyterlab/toc
{% set version = "0.5.0" %}
package:
name: go-ipfs
version: {{ version }}
source:
url: https://github.com/ipfs/go-ipfs/releases/download/v{{ version }}/go-ipfs-source.tar.gz
sha256: f0f9f3d7708cfbde95bbcae0543fc873a5a46824be17e94ad95f39a182fae356
build:
number: 0
detect_binary_files_with_prefix: False
requirements:
build:
- {{ compiler('c') }}
- go-cgo
- make
host:
- openssl
run:
- openssl
test:
requires:
- python >=3
about:
home: https://ipfs.io
license: Apache-2.0
license_family: APACHE
license_file: LICENSE-APACHE
summary: 'IPFS implementation in Go'
# The remaining entries in this section are optional, but recommended.
description: |
IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas
from previous systems such as Git, BitTorrent, Kademlia, SFS, and the Web.
It is like a single BitTorrent swarm, exchanging git objects. IPFS provides
an interface as simple as the HTTP web, but with permanence built-in. You
can also mount the world at /ipfs.
doc_url: https://docs.ipfs.io
dev_url: https://github.com/ipfs/go-ipfs
extra:
recipe-maintainers:
- bollwyvl
#!/usr/bin/env bash
set -eux
mkdir recipe
cp meta.yaml run_test.py build.sh recipe/
conda-build -c conda-forge recipe --output-folder $(pwd)/build/conda-bld
conda install -yc conda-forge -c file://$(pwd)/build/conda-bld go-ipfs
jupyter labextension install --no-build $(cat labex.txt)
jupyter lab build --dev-build=False --minimize=True --debug
from subprocess import check_call
import os
from pathlib import Path
os.environ["IPFS_PATH"] = str((Path.cwd() / "ipfs-repo").resolve())
check_call(["ipfs", "init"])
check_call(["ipfs", "cat", "/ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme"])
Path("hello").write_text("hello world")
check_call(["ipfs", "add", "hello"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment