Differences between revisions 58 and 59
Revision 58 as of 2022-11-07 23:41:39
Size: 8843
Editor: TunayDurmaz
Comment:
Revision 59 as of 2022-11-07 23:43:01
Size: 8843
Editor: TunayDurmaz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 57: Line 57:



== Feedstocks ==
 * https://github.com/cryoem/eman-deps-feedstock
 * https://github.com/cryoem/pydusa-feedstock
 * https://github.com/cryoem/eman-feedstock

=== General instructions ===
 1. Existing feedstocks
 1. Files to edit: recipe/, conda-build.yaml, conda-forge.yaml
 1. conda create -n smithy conda-smithy -c conda-forge
 1. conda-smithy rerender
 1. More info in conda-smithy/README.md, conda smithy -h, conda-forge.org/docs
 1. New feedstocks
 1. conda-smithy/README.md, conda smithy -h

=== Conda-smithy Workflow ===

Conda smithy uses tokens to authenticate with !GitHub.
 {{{#!highlight yaml
# conda-forge.yml

channels:
  sources: [cryoem, defaults, conda-forge]
  targets:
  - [cryoem, main]

github:
  user_or_org: cryoem
  repo_name: <package>-feedstock

provider:
  linux: circle
  osx: travis
  win: appveyor

azure:
  build_id: blank
}}}

 {{{#!highlight yaml
# recipe/conda_build_config.yaml

channel_sources:
- cryoem, defaults,conda-forge
channel_targets:
- cryoem dev

}}}

Conda-smithy commands:
 {{{#!highlight bash
conda create -n smithy conda-smithy
conda activate smithy
conda smithy init <recipe_directory>
conda smithy register-github <feedstock_directory> --organization cryoem
conda smithy register-ci --organization cryoem --without-azure --without-drone
conda smithy rerender --no-check-uptodate
}}}





== Anaconda ==

Dependencies not available on anaconda or conda-forge are available [[https://anaconda.org/cryoem/|cryoem]]. The binaries are built and uploaded using [[https://conda-forge.org/|conda-forge's]] [[https://github.com/conda-forge/conda-smithy|conda-smithy]]. [[https://github.com/conda-forge/conda-smithy|conda-smithy]] takes care of generating feedstocks, registering them on !GitHub and online CI services and building conda recipes.
Line 155: Line 86:
== Feedstocks ==
 * https://github.com/cryoem/eman-deps-feedstock
 * https://github.com/cryoem/pydusa-feedstock
 * https://github.com/cryoem/eman-feedstock

=== General instructions ===
 1. Existing feedstocks
 1. Files to edit: recipe/, conda-build.yaml, conda-forge.yaml
 1. conda create -n smithy conda-smithy -c conda-forge
 1. conda-smithy rerender
 1. More info in conda-smithy/README.md, conda smithy -h, conda-forge.org/docs
 1. New feedstocks
 1. conda-smithy/README.md, conda smithy -h

=== Conda-smithy Workflow ===

Conda smithy uses tokens to authenticate with !GitHub.
 {{{#!highlight yaml
# conda-forge.yml

channels:
  sources: [cryoem, defaults, conda-forge]
  targets:
  - [cryoem, main]

github:
  user_or_org: cryoem
  repo_name: <package>-feedstock

provider:
  linux: circle
  osx: travis
  win: appveyor

azure:
  build_id: blank
}}}

 {{{#!highlight yaml
# recipe/conda_build_config.yaml

channel_sources:
- cryoem, defaults,conda-forge
channel_targets:
- cryoem dev

}}}

Conda-smithy commands:
 {{{#!highlight bash
conda create -n smithy conda-smithy
conda activate smithy
conda smithy init <recipe_directory>
conda smithy register-github <feedstock_directory> --organization cryoem
conda smithy register-ci --organization cryoem --without-azure --without-drone
conda smithy rerender --no-check-uptodate
}}}





== Anaconda ==

Dependencies not available on anaconda or conda-forge are available [[https://anaconda.org/cryoem/|cryoem]]. The binaries are built and uploaded using [[https://conda-forge.org/|conda-forge's]] [[https://github.com/conda-forge/conda-smithy|conda-smithy]]. [[https://github.com/conda-forge/conda-smithy|conda-smithy]] takes care of generating feedstocks, registering them on !GitHub and online CI services and building conda recipes.



Jenkins

  1. Login info: 10.10.11.176:8080/ username: eman2
  2. Jobs
  3. Settings, Plugins ?
  4. Binary builds require conda-build, constructor

Jenkins Setup

Jenkins run command(?)

Server on Linux, agents on Linux, Mac and Windows

Jobs:

  • multi: Triggers job cryoem-eman2 on agents
  • cryoem-eman2: Test(?) and binary builds
  • eman-dev(?): Triggers new build of eman-dev

Jenkins Setup on Linux

Credentials

PATH

Jenkins Setup

  1. Jenkins master needs PATH prepended with $CONDA_PREFIX/bin
  2. docker-compose.yml at home dir in build machines
  3. TZ: https://stackoverflow.com/a/46384925

  4. Agent nodes setup
  5. Server and agent per machine vs single server and os agents

Linux

docker run -d -u root -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins:lts &

docker run -d -u root --name jenkins-master -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -e PLUGINS_FORCE_UPGRADE=true -e TRY_UPGRADE_IF_NO_MARKER=true --restart unless-stopped cryoem/jenkins:dev

Mac

slave clock sync https://blog.shameerc.com/2017/03/quick-tip-fixing-time-drift-issue-on-docker-for-mac docker run --rm --privileged alpine hwclock -s

Windows

OPENGL: https://github.com/conda/conda-recipes/blob/master/qt5/notes.md

Continuous Integration

  1. GitHub webhooks are setup to send notifications to blake. Blake forwards those to three build machines, although only Linux is sufficient. Linux runs the server that drives the the Jenkins jobs.

  2. Binary builds on local build machines.
    1. Manually triggered by including "[ci build]" anywhere in the last commit message. Manually triggered builds on master branch are uploaded as continuous builds and builds triggered from any other branch are uploaded to testing area.

    2. Triggered by cron builds daily.

    3. Any branch in the form of "release-" triggers continuous builds without having to include "[ci build]" in the commit message. Once the release branch is ready, release binaries are manually copied from cont. builds folder into the release folder on the server.
  3. CI configurations files:
    1. CircleCI: .circleci/config.yml

    2. TravisCI: .travis.yml

    3. Appveyor: appveyor.yml

    4. JenkinsCI: Jenkinsfile

      1. Secrets like ssh keys are stored locally in Jenkins
      2. Some env vars need to be set by agents:
        1. HOME_DIR, DEPLOY_PATH, PATH+EXTRA (to add miniconda to PATH).
        2. PATH+EXTRA is not set on win. (?)
          1. Now, it is set on win, too.
      3.  Launch method: via SSH
           Advanced:
             Prefix Start Agent Command: "D: && "
      4. On windows for sh calls in jenkins to work "Git for Windows" might need to be installed.

Feedstocks

General instructions

  1. Existing feedstocks
  2. Files to edit: recipe/, conda-build.yaml, conda-forge.yaml
  3. conda create -n smithy conda-smithy -c conda-forge
  4. conda-smithy rerender
  5. More info in conda-smithy/README.md, conda smithy -h, conda-forge.org/docs
  6. New feedstocks
  7. conda-smithy/README.md, conda smithy -h

Conda-smithy Workflow

Conda smithy uses tokens to authenticate with GitHub.

  •    1 # conda-forge.yml
       2 
       3 channels:
       4   sources: [cryoem, defaults, conda-forge]
       5   targets:
       6   - [cryoem, main]
       7 
       8 github:
       9   user_or_org: cryoem
      10   repo_name: <package>-feedstock
      11 
      12 provider:
      13   linux: circle
      14   osx: travis
      15   win: appveyor
      16 
      17 azure:
      18   build_id: blank
    
       1 # recipe/conda_build_config.yaml
       2 
       3 channel_sources:
       4 - cryoem, defaults,conda-forge
       5 channel_targets:
       6 - cryoem dev
    

Conda-smithy commands:

  •    1 conda create -n smithy conda-smithy
       2 conda activate smithy
       3 conda smithy init <recipe_directory>
       4 conda smithy register-github <feedstock_directory> --organization cryoem
       5 conda smithy register-ci --organization cryoem --without-azure --without-drone
       6 conda smithy rerender --no-check-uptodate
    

Anaconda

Dependencies not available on anaconda or conda-forge are available cryoem. The binaries are built and uploaded using conda-forge's conda-smithy. conda-smithy takes care of generating feedstocks, registering them on GitHub and online CI services and building conda recipes.

EMAN2 is built with conda-build using binaries from https://anaconda.org, packaged into an installer with constructor as of v2.2.

  1. conda is the package manager.

  2. https://anaconda.org is the online repository of binaries.

  3. conda-build is the tool to build from source.

  4. constructor is the tool to package eman2 and dependency binaries into a single installer file.

EMAN2 is distributed as a single installer which includes all its dependencies.

Conda

Packages that are available on https://anaconda.org can be installed into any conda environment by issuing the command conda install <package>. Conda installs the package along with its dependencies. In order for packages to benefit from this automation, they need to be packaged in a specific way. That can be done with conda-build. conda-build builds packages according to instructions provided in a recipe. A recipe consists of a file with package metadata, meta.yaml, and any other necessary resources like build scripts, (build.sh, bld.bat), patches and so on.

Recipes, Feedstocks and anaconda.org channel: cryoem

Most of EMAN2 dependencies can be found on anaconda's channels, defaults and conda-forge. A few that do not exist or need to be customized have been built and uploaded to channel cryoem. The recipes are hosted in separate repositories on GitHub. Every recipe repository follows the feedstock approach of conda-forge. See here for a complete list.

Binary Distribution

Constructor

Packaging is done with constructor, a tool for making installers from conda packages.

Build System Notes

CMake

  1. libpython can be linked statically or dynamically when python is built. It is important for python extensions to be aware of the type of linking in order to avoid segfaults. This can be accomplished by querying Py_ENABLE_SHARED.

       1 python -c "import sysconfig; print(sysconfig.get_config_var('Py_ENABLE_SHARED'))"
    

    In EMAN, it is done in cmake/FindPython.cmake

  2. OpenGL detection when Anaconda's compilers are used is done using a cmake toolchain file.

  3. glext.h file needed for OpenGL related module compilation is already present on Linux and Mac. On Windows, it is manually copied once into C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl. On Appveyor it is downloaded as part of env setup every time a test is run.

Docker

Docker images and helper scripts are at https://github.com/cryoem/docker-images https://github.com/cryoem/build-scripts.

Command to run docker with GUI support, CentOS7:

xhost + local:root

docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY cryoem/eman-nvidia-cuda8-centos7

# When done with eman
xhost - local:root

:FIXME: Runs as root on Linux. chown doesn't work, the resulting installer has root ownership.

EMAN2/BuildSystem (last edited 2022-12-12 03:42:44 by TunayDurmaz)