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

Installer for macos #39

Open
mocher72 opened this issue Dec 1, 2023 · 1 comment
Open

Installer for macos #39

mocher72 opened this issue Dec 1, 2023 · 1 comment

Comments

@mocher72
Copy link

mocher72 commented Dec 1, 2023

I downloaded the zip and unzipped it locally but found setting visibility difficult to do so that the jupyter notabokk could us the conjure plugin.

I modified the linux install shell script to work for macos.
I tested this on my Sonoma install and it seems to work.

There are still issues with having to set the run permissions due to security, which you have to do for each executable but that is another issue, maybe this could be sandboxed somehow.

I have pasted the shell script here.

#!/bin/bash

set -o errexit
set -o nounset

CONJURE_VERSION=v2.5.1
NOTEBOOK_VERSION=main

echo "Installing Conjure version ${CONJURE_VERSION} and Conjure Notebook version ${NOTEBOOK_VERSION}..."

# remove the sample-data directory that google colab creates, we don't need them
# rm -rf sample_data

conjure_installed=$((conjure --version 2> /dev/null) | head -n2 | tail -n1)

if [[ $conjure_installed == "Release version 2.5.1" ]]; then
    echo "Conjure is already installed."
else
    echo "Downloading..."
    # download the release from Github
    wget --quiet --no-check-certificate -c https://github.com/conjure-cp/conjure/releases/download/${CONJURE_VERSION}/conjure-${CONJURE_VERSION}-macos-arm-with-solvers.zip
    unzip -q -o conjure-${CONJURE_VERSION}-macos-arm-with-solvers.zip
    cp -r conjure-${CONJURE_VERSION}-macos-arm-with-solvers/* /usr/local/bin

    # we don't need to keep these around any more
    rm -rf conjure-${CONJURE_VERSION}-macos-arm-with-solvers conjure-${CONJURE_VERSION}-macos-arm-with-solvers.zip
fi

conjure_notebook_installed=$(pip freeze | grep Conjure-Notebook | wc -l)

if [[ $conjure_notebook_installed == "1" ]]; then
    echo "Conjure notebook is already installed."
else
    # installing the conjure extension
    pip --quiet install git+https://github.com/conjure-cp/conjure-notebook.git@${NOTEBOOK_VERSION} > /dev/null
fi

conjure --version
@ozgurakgun
Copy link
Contributor

Thanks for this!

Alternative would be docker/podman.

Something like the following should work out of the box for example: podman run -it --rm --network=none ghcr.io/conjure-cp/conjure:v2.5.1 conjure --help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants