-
Notifications
You must be signed in to change notification settings - Fork 53
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
NixOS compatibility (via nix-shell) #36
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
ENV_PYTHON_TEST="$ENV_BINIOU_PYTHON_VER" | ||
if [ "$ENV_PYTHON_TEST" != "" ] | ||
then | ||
|
@@ -12,17 +12,18 @@ mkdir -p ./ssl | |
mkdir -p ./models/Audiocraft | ||
|
||
## Creating self-signed certificate | ||
openssl req -x509 -newkey rsa:4096 -keyout ./ssl/key.pem -out ./ssl/cert.pem -sha256 -days 3650 -nodes -subj "/C=FR/ST=Paris/L=Paris/O=Biniou/OU=/CN=" | ||
[ ! -e ./ssl/key.pem ] && openssl req -x509 -newkey rsa:4096 -keyout ./ssl/key.pem -out ./ssl/cert.pem -sha256 -days 3650 -nodes -subj "/C=FR/ST=Paris/L=Paris/O=Biniou/OU=/CN=" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for not seeing it before : don't do that. There's zero reasons for this certificate to exist, as this is script is not handling at all an existing installation. |
||
|
||
## Creating virtual environment | ||
eval $PYTHON_VER -m venv ./env | ||
source ./env/bin/activate | ||
|
||
## Install packages : | ||
set -e # stop if any command below fails | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't do that : warnings in the installation of some components sometimes gives useful hints for debugging. Blame is on my installer, that should handle correctly failures. |
||
pip install -U pip | ||
pip install wheel | ||
pip install torch==2.1.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | ||
FORCE_CMAKE=1 pip install llama-cpp-python | ||
pip install -r requirements.txt | ||
FORCE_CMAKE=1 pip install llama-cpp-python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See following comment. |
||
# pip install torch==2.1.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely don't do that ! If all the changes you made in install.sh (except for the shebang) have a real interest for NixOS, please provide a specific install_nix.sh and update documentation. |
||
|
||
exit 0 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to be tested, but Ok for that. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
stdenv.cc.cc.lib | ||
python311 | ||
openssl | ||
perl | ||
ffmpeg | ||
gperftools | ||
libGL | ||
libGLU | ||
glib | ||
xorg.libX11 | ||
xorg.libXi | ||
xorg.libXmu | ||
xorg.libXext | ||
xorg.libXt | ||
xorg.libXfixes | ||
xorg.libXrender | ||
xorg.libXcursor | ||
xorg.libxcb | ||
xorg.libXinerama | ||
xorg.libXrandr | ||
xorg.libXcomposite | ||
]; | ||
|
||
shellHook = '' | ||
export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH | ||
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ | ||
pkgs.libGL | ||
pkgs.libGLU | ||
pkgs.xorg.libX11 | ||
pkgs.glib | ||
]}:$LD_LIBRARY_PATH | ||
''; | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to be tested, but Ok for that. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to be tested, but Ok for that. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to be tested, but Ok for that. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to be tested, but Ok for that. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
## Detection of TCMalloc | ||
RELEASE="$(cat /etc/os-release|grep ^ID)" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be tested and rebased, but Ok for that.
Very nice work by the way ! :)