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

add conda/mamba environment file for local deployment? #13

Open
MathewBiddle opened this issue Aug 24, 2023 · 4 comments
Open

add conda/mamba environment file for local deployment? #13

MathewBiddle opened this issue Aug 24, 2023 · 4 comments

Comments

@MathewBiddle
Copy link
Contributor

I recently had to use a loaner laptop and needed to build out my environments again. As I was doing so, I thought that it would be helpful to have an environment just for docs and we could add that environment file to this repo (or one of the submodules).

Then the readme here would be:

git clone https://github.com/ioos/ioos-documentation-jekyll-skeleton.git
conda create env -f environment.yml
bundle exec jekyll serve --config _config.yml --watch --verbose --incremental

Might be missing some key details.

@MathewBiddle
Copy link
Contributor Author

Found a good blog with an example workflow: https://hackmd.io/@AstrobioMike/jekyll-conda-setup

conda create -y -n jekyll -c conda-forge rb-jekyll c-compiler compilers cxx-compiler

conda activate jekyll

gem install bundler

# running this in the repo with the Gemfile
bundle update

# make sure these are all being called from the same conda environment (and no other system-wide ones are mucking things up)
where ruby
where bundle
where bundler
where gem

bundle exec jekyll serve

@ocefpaf
Copy link
Member

ocefpaf commented Dec 11, 2023

I guess that the devil is in the details I had to do this the last time I used jekyll with an IOOS Gemfile on Linux:

conda env create --name JEKYLL compilers "ruby<3"
gem update --system
gem install sass-embedded -v 1.63.6
gem install jekyll
gem install bundler
bundle install
ln -s /home/filipe/micromamba/envs/JEKYLL/bin/ruby /home/filipe/micromamba/envs/JEKYLL/share/rubygems/bin/ruby
bundle exec jekyll serve --config _config.yml,_config_dev.yml --watch

The main differences are:

  • install the compilers package instead of the individual compilers (that is safer when updating the env).
  • update before installing
  • pin SASS b/c the latest one did not work with jekyll
  • created a symlink b/c for some reason, ruby could not be found
  • used both dev and normal config when building locally to avoid mismatched slugs

@MathewBiddle
Copy link
Contributor Author

Okay, so that's not as easy as I was hoping. If it's that complex, than maybe the environment file isn't worth the effort? Folks can just install to their OS directly, per our guidance here.

@ocefpaf
Copy link
Member

ocefpaf commented Dec 12, 2023

Okay, so that's not as easy as I was hoping. If it's that complex, than maybe the environment file isn't worth the effort? Folks can just install to their OS directly, per our guidance here.

The problem is the many layers of packages and managers. We use conda to install gems to install bundle :-/

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