Skip to content

Commit 70d76b0

Browse files
Merge pull request #20 from stan-dev/conda-tgz-script
Added colab build script
2 parents af735c2 + 2df803d commit 70d76b0

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

release-scripts/build-conda-tgz.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Script used to install cmdstan on a GColab Machine and create a .tgz archive with the installation
4+
5+
# Arguments:
6+
# $1: cmdstan version in the form of 2.29.0 (major.minor.patch)
7+
8+
# On a fresh colab instance simply run:
9+
# !curl https://raw.githubusercontent.com/stan-dev/ci-scripts/master/release-scripts/build-conda-tgz.sh | bash -s -- 2.29.0
10+
# You can follow all the progress in the console, should take around 10 minutes
11+
# At the end the console will print a URL where you can download the .tgz archive
12+
13+
VERSION="$1"
14+
INSTALLATION_HOME="/root"
15+
16+
echo "Creating v$VERSION conda .tgz archive !"
17+
18+
# Install cmdstanpy
19+
pip install --upgrade cmdstanpy
20+
21+
# Install cmdstan
22+
python -c "from cmdstanpy import install_cmdstan; install_cmdstan(cores=2, progress=True, version=\"$VERSION\")"
23+
24+
# Create tgz archive
25+
cd $INSTALLATION_HOME/.cmdstan; tar -cf - cmdstan-$VERSION | gzip > $INSTALLATION_HOME/cmdstan-$VERSION.tgz
26+
tar -tzf $INSTALLATION_HOME/cmdstan-$VERSION.tgz | head
27+
28+
# Use transfer.sh to upload our achive for easy retrieval
29+
curl --upload-file /root/cmdstan-$VERSION.tgz https://transfer.sh/cmdstan-$VERSION.tgz

0 commit comments

Comments
 (0)