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

Ibek j20 changes #3

Merged
merged 26 commits into from
Sep 22, 2023
Merged

Ibek j20 changes #3

merged 26 commits into from
Sep 22, 2023

Conversation

gilesknap
Copy link
Member

@gilesknap gilesknap commented Sep 18, 2023

This is a major refactor to tidy up ioc compilation in epics-containers

See related changes in the first test ioc here epics-containers/ioc-adsimdetector#1

@gilesknap gilesknap marked this pull request as draft September 18, 2023 20:28
@gilesknap gilesknap requested a review from coretl September 18, 2023 20:29
@gilesknap
Copy link
Member Author

gilesknap commented Sep 18, 2023

@coretl its getting to the point where I am happy with it.

I think we need a 'add block to file' function which would make the changes here https://github.com/epics-containers/ibek-support/blob/ibek-j20-changes/ADSupport/install.sh#L26-L62 in an idempotent fashion.

@coretl coretl requested a review from GDYendell September 19, 2023 08:01
Copy link

@coretl coretl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much neater.

We definitely need support.py for those things that are best written in python, but I think we should go down one route:

  1. Public interface is bash functions only that may call into support.py (but we hide this fact away)
  2. Public interface is python functions only in support.py and we ditch the bash

If we do 1 we would have things like add_module_to_release instead of support add-module-to-release, but functions would grow.

If we do 2 we would have things like ${SUPPORT} git-clone-tag ${NAME} ${VERSION} --org=https://github.com/areaDetector instead of git_clone_tag ${NAME} ${VERSION} https://github.com/areaDetector, but there would be no bash functions to read.

I don't know which is better. @GDYendell thoughts?

iocStats/dbd Outdated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we like the separate files for lib and dbd?

git_clone_tag ${NAME} ${VERSION}

support add-module-to-release ${NAME}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should we have

add_ioc_libs devIocStats
add_ioc_dbds devIocStats.dbd

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I MUCH prefer this. Forgot that I wanted to review this bit before doing the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now implemented

@GDYendell
Copy link
Member

GDYendell commented Sep 19, 2023

Public interface is python functions only in support.py and we ditch the bash

Including ditching the <support module>/install.sh scripts?

@gilesknap
Copy link
Member Author

gilesknap commented Sep 19, 2023 via email

@coretl
Copy link

coretl commented Sep 19, 2023

Public interface is python functions only in support.py and we ditch the bash

Including ditching the <support module>/install.sh scripts?

I meant ditch the bash functions... install.sh would remain

@gilesknap
Copy link
Member Author

@GDYendell @coretl We have decided to ditch functions.sh and go pure python.

Custom steps inside of install.sh instances would use bash commands if appropriate but can also call python,

@gilesknap
Copy link
Member Author

OK @coretl @GDYendell the yet another refactor is complete.

There is now no functions.sh and all functions have been moved into ibek.

See the related PRs at:

epics-containers/ibek#107
To see how the support functions have been integrated into ibek

epics-containers/ioc-adsimdetector#1
To see what a Dockerfile for a generic IOC looks like now

In this repo you will want to look at the install.sh files for each support module. In particular I realized that the same CONFIG_SITE changes were required in ADCore and ADSimDetector. These changes are really at the generic IOC level rather than at the support module level. Therefore I have provided a mechanism for supplying parameters from the IOC (see https://github.com/epics-containers/ioc-adsimdetector/blob/ibek-j20-changes/generic_config_AD/config_site)

@gilesknap gilesknap marked this pull request as ready for review September 20, 2023 17:05
@gilesknap
Copy link
Member Author

Note I still need to add tests for the ibek support features.

@gilesknap
Copy link
Member Author

@coretl @GDYendell

After the latest changes we have a pretty neat Dockerfile

The most basic install.sh is tidy.

The whole build of ADSimDetector generic IOC container takes under 4 mins. so I'm voting for keeping ADCore build in the individual Generic IOCs. This includes all the optional ADCore features except GraphicsMagic but no use of ADSupport.

The final bit to do is tidy up the apt installs. Here is ADCore install.h as it stands.

I'm wondering if there is any benefit in having ibek functions that just call back out to bash. But having said that I thought that:-

  • I could have ibek support apt-install take a list that includes http:// urls and knows to wget them first.
  • We need to declare what apt installs are required in the runtime stage and and ibek command for that could collect the list from each support module and then perform the install in the final stage.

Therefore I argue that I might as well add:

  • ibek support apt-install [list of pakcages / http addtesses]
  • ibek support apt-install-runtime [list of pakcages / http addtesses]

@coretl
Copy link

coretl commented Sep 21, 2023

After the latest changes we have a pretty neat Dockerfile

Excellent, is ibek-support/_global/global.sh still the source of global patches, or is that moved to ibek now?

The most basic install.sh is tidy.

That looks very neat

The whole build of ADSimDetector generic IOC container takes under 4 mins. so I'm voting for keeping ADCore build in the individual Generic IOCs. This includes all the optional ADCore features except GraphicsMagic but no use of ADSupport.

That makes sense

The final bit to do is tidy up the apt installs. Here is ADCore install.h as it stands.

Yes, and we don't do composition of the runtime stage apt installs at the moment...

I'm wondering if there is any benefit in having ibek functions that just call back out to bash. But having said that I thought that:-

* I could have `ibek support apt-install` take a list that includes `http:// urls` and knows to wget them first.

* We need to declare what apt installs are required in the runtime stage and and ibek command for that could collect the list from each support module and then perform the install in the final stage.

Therefore I argue that I might as well add:

* ibek support apt-install [list of pakcages / http addtesses]

* ibek support apt-install-runtime [list of pakcages / http addtesses]

That sounds reasonable, but there are likely to be some that are installed at dev and runtime (like the hdf ones), so how about:

  • ibek support apt-install [list of package names / addresses] install now and put in the runtime install list
  • ibek support apt-install --only dev [list of package names / addresses] install now
  • ibek support apt-install --only run [list of package names / addresses] put in the runtime install list

@gilesknap
Copy link
Member Author

Right - had a bit of a hiccup with a trivial problem that required rebuild of all container stages. Because it was an interaction between the dev and run stages. So wasted too much time on that:

    if only is AptWhen.run or AptWhen.both:
        add_list_to_file(RUNTIME_DEBS, debs)

Is NOT the same as:-

    if (only is AptWhen.run) or (only is AptWhen.both):
        add_list_to_file(RUNTIME_DEBS, debs)

DOH! maybe I need some sleep.

Anyway @coretl @GDYendell I feel ready to merge.

Let me know what you think. Here is what ADCore install.sh now looks like.
And here is the Dockerfile for ioc_adsimdetctor

I kinda like it.

Thanks for iterating on this with me, Both. Its been very useful (my first attempt at an install.sh was crap - but useful for starting the discussion)

Regarding global.sh - its not currently doing anything and I will look at it again when I get to RTEMS. I think its nice to have a place where you can change global patching without rebuilding ibek so maybe ibek should call a script ... no sure.

@GDYendell
Copy link
Member

I think this looks really good now!

I am a bit confused about ibek support apt-install --runtime vs ibek support apt-install --only=run. The latter configures the packages to be installed and also installs it into the current running container and the former pulls packages from the file to install, is that right? Are these mutually exclusive flags or might they be used together? Is the intention that ioc container Dockerfile might run RUN ibek support apt-install ... with some explicit packages, rather than just reading the runtime packages file?

@gilesknap
Copy link
Member Author

I think this looks really good now!

I am a bit confused about ibek support apt-install --runtime vs ibek support apt-install --only=run. The latter configures the packages to be installed and also installs it into the current running container and the former pulls packages from the file to install, is that right? Are these mutually exclusive flags or might they be used together? Is the intention that ioc container Dockerfile might run RUN ibek support apt-install ... with some explicit packages, rather than just reading the runtime packages file?

They are not mutually exclusive but you would normally only use --runtime in the runtime section.

ibek support apt-install --runtime mypackage1 mypackage2

would install all the things that had previously been declared with a --run (or --both - the default) plus the two mypackage?

`ibek support apt-install --run --runtime xxx

would install all the packages declared, plus xxx plus it would add xxx to the runtime list (not something you want to do really but its sort of consistent right? ??? )

@gilesknap gilesknap force-pushed the ibek-j20-changes branch 12 times, most recently from e5f3910 to 00c961a Compare September 22, 2023 10:32
@gilesknap gilesknap merged commit 41f79af into main Sep 22, 2023
2 checks passed
@gilesknap gilesknap deleted the ibek-j20-changes branch December 15, 2023 14:41
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

Successfully merging this pull request may close these issues.

3 participants