Skip to main content

The NDIF server, which performs deep inference and serves nnsight requests remotely

Project description

NDIF Development Guide

This guide explains how to set up a development environment, install dependencies, and get started with contributing to the NDIF project.

Prerequisites

  • Python 3.10
  • Docker
  • Docker Compose

Setup

1. Install Conda

If you don’t have Conda installed, download and install Anaconda or Miniconda from the official Conda website.

2. Create Conda Environment

Fork the NDIF repository (or clone it directly) to your local machine. Then create a new Conda virtual environment:

conda create -n ndif-dev python=3.10
conda activate ndif-dev

3. Install NNsight

Choose one of the following methods:

a. Via pip (simple)

pip install nnsight

b. From repository (recommended for specific branches)

git clone https://github.com/nnsight/nnsight.git
cd nnsight
git checkout <branch-name>  # e.g., 0.3
pip install -e .

Building and Running NDIF

1. Build and start the development environment

For first-time setup, use:

make build

If you’ve made changes to the codebase but did not modify the environment.yml files, you can quickly rebuild the services using:

make ta

This method is faster than running make build again.

2. Verify server status

After building the NDIF containers, you can check the docker logs to verify the services are running correctly.

docker logs dev-api-1

You should expect to see a message like Application startup complete. in the api service log.

3. Run tests

python scripts/test.py

For more comprehensive testing, install pytest

Navigate to the service you wish to test

cd src/services/api
pytest

This will send a test NNsight request to the API service running in the local container.

Additional Commands

  • To start the deployment environment without rebuilding:
make up
  • To stop the development environment:
make down
  • To rebuild services and restart the environment (useful during development):
make ta

Note: Modifying any of the environment.yml files will require you to rebuild from scratch.

Environment Configuration

The project uses separate .env files for development and production environments:

  • Development: compose/dev/.env
  • Production: compose/prod/.env

For most users, only the development environment is necessary. The production environment is configured separately and is not required for local development.

Note

The Makefile includes configurations for both development and production environments. As an end user or developer, you'll primarily interact with the development environment. The production environment settings are managed separately and are not typically needed for local development work.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndif-0.0.1.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ndif-0.0.1-py3-none-any.whl (110.8 kB view details)

Uploaded Python 3

File details

Details for the file ndif-0.0.1.tar.gz.

File metadata

  • Download URL: ndif-0.0.1.tar.gz
  • Upload date:
  • Size: 76.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ndif-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7fff610e700ddc57697499472d05bd09f25483f31c0c998c41c9ab54ef78122b
MD5 557069d298f7dbe64121291d19a129c0
BLAKE2b-256 5c19ddbe330ed537c23ee38129560fb624ac9cae28cbd0b5fa4c1b916dbe4177

See more details on using hashes here.

File details

Details for the file ndif-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ndif-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 110.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ndif-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 490dec98795eac11173325ea066615b46ee5b782106d31ba54c7fd7f016b1eb4
MD5 b4af47f257a1772a19b4e340d042b110
BLAKE2b-256 105a414701f90c49fd9946e0e698f6a9b2f7f39d2c5185591a4d6b01dc9efe34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page