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

ska3-perl for shiny release candidate #508

Merged
merged 5 commits into from
Nov 2, 2020
Merged

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Oct 30, 2020

Make a ska3-perl versioned metapackage for the shiny release candidate.

Update combine_arch helper/utility script to with an option to subtract off the packages described by another platform-specific json file. This new option was used to make the ska3-perl metapackage as the ska3-perl package should basically be the difference between the environment defined by (ska3-core ska3-flight ska3-perl-latest) and the one defined by (ska3-core ska3-flight).

@jeanconn jeanconn requested a review from javierggt October 30, 2020 02:09
@taldcroft
Copy link
Member

I don't have time to scrutinize the code now, but can you please provide a proper description for this PR of the rationale for the change and the intended use case.

@jeanconn
Copy link
Contributor Author

Little confused by what is a proper description given context? I just thought we wanted a ska3-perl metapackage with a set of package versions to go into shiny... but sure.

@jeanconn jeanconn changed the title ska3-perl for shiny release candidate WIP: ska3-perl for shiny release candidate Oct 30, 2020
@jeanconn
Copy link
Contributor Author

jeanconn commented Oct 30, 2020

This is a tiny PR against 2020.13+shiny branch. I was originally going to push these two tiny commits directly to 2020.13+shiny branch, but figured that it would be a bit rude without letting Javier have a look.

In 2020.13+shiny there's a new combine_arch.py to make ska3-core. That script has logic to take the package versions from two platforms, subtract ska packages, and make one list of everything left over. We also have need for a platform-specific all-versioned package for ska3-perl made from the "extra" packages installed in ska3 by the ska3-perl-latest package, so some of the combine_arch code seemed useful. It seemed to me that the easiest way to do that was to make an environment with ska3-core ska3-flight ska3-perl-latest, and subtract off all the packages already defined in an environment created just by ska3-core ska3-flight. so I added code to the modified combine_arch.py helper script to remove packages on a platform from a separate json.

For this PR, the question is really: should these changes end up in combine_arch.py or should I just toss it into a gist like Javier's at https://gist.github.com/javierggt/f64fd5300c1e946e9f3f52f483195e8c ? They probably don't belong in combine_arch if we leave that script hanging around in the ska3-core directory. It just seemed to me that it was becoming a bit more general.

I've changed this to a WIP because I haven't tested both ska3-perl packages.

@jeanconn jeanconn changed the title WIP: ska3-perl for shiny release candidate ska3-perl for shiny release candidate Oct 30, 2020
@jeanconn
Copy link
Contributor Author

I confirmed the ska3-perl packages build and look to work so I just removed the WIP.

@javierggt
Copy link
Contributor

javierggt commented Oct 30, 2020

@taldcroft, the bottomline is this:

  • the intention is to set the package versions in ska3-perl/meta.yaml.
  • Jean is doing that by listing packages required by ska3-perl-latest which are not in a ska3-core-latest environment, and she made changes to the script to produce the list.

I suggested just listing packages installed by ska3-perl-latest (without removing packages in ska3-core) unless we make ska3-core a requirement of ska3-perl.

For example, if you create a fresh environment and install ska3-core-latest, you will have yaml, sqlite, numpy and others. If you install just ska3-perl you might not get those, because they come through ska3-core and ska3-core is not a requirement.

@jeanconn
Copy link
Contributor Author

If we aren't going to be making new ska3-core packages really often, I don't care, so I just added ska3-core to the draft ska3-perl metapackage. I also don't know how much we need to refine process for updating the all-versioned metapackages.

So I don't know what we want to do with this PR. I was anticipating a small amount of review and refinement from @javierggt and then a merge into the development branch with the idea that @taldcroft will be reviewing the bigger PR on the 2020.13+shiny branch next week.

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

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

In general this looks OK and the meta.yaml looks reasonable.

My real comment which is more substantial is that we need the process of generating this file to be documented and reproducible. In this case Jean needed to think about things and then make two more commits. We will go through this whole exercise again in maybe 2 years by which time all of this will be forgotten entirely (by me anyway). So no hand-edits, or if there are then they need to be carefully documented.

To that end, one path forward is:

  • Move watch_cron_logs and task_schedule into ska3-flight. Honestly I really don't care that they get installed and won't run. There is nobody that will try to do this and get confused because they don't run. The user community for those packages is us three.
  • Remove the dependence on ska3-core here. Indeed nothing will work without ska3-core. Is there any single user that will get tripped up by this? No.

What I am saying here is to emphasize process simplicity over the perfection of having all the dependencies correct for mix-n-match installation of different components. This latter feature of conda is not a requirement for Ska3 meta packages now and I haven't yet heard a compelling reason to support this (given the real cost of doing so).

With that I think of this meta package as being essentially a plug-in to Ska3. Of course it won't work if you don't have ska3-core installed, but do we care? My feeling is no.

If we take this approach then I think (??) that the current combine_arch.py will generate the correct file out of the box and we're done and having something simple to document/maintain and reproducible.

pkg_defs/ska3-core/combine_arch.py Show resolved Hide resolved
pkg_defs/ska3-perl/meta.yaml Show resolved Hide resolved
@jeanconn
Copy link
Contributor Author

jeanconn commented Oct 31, 2020

Awesome. Thanks for the feedback Tom!

My real comment which is more substantial is that we need the process of generating this file to be documented and reproducible.

Agree 100%. I have notes but was planning to finalize them after reusing whatever we decided as a final script to remake the meta.yaml in a process that would end up at the bottom of the shiny twiki page with Javier's notes.

Move watch_cron_logs and task_schedule into ska3-flight. Honestly I really don't care that they get installed and won't run. There is nobody that will try to do this and get confused because they don't run. The user community for those packages is us three.

Sure. That's a path forward. I think it is probably more trivial to update the script to make ska3-perl to include them correctly? But if you think it makes more sense for them to live in ska3-flight that's fine. I know we'd gone back and forth on them. I suppose I'd just need to start by cutting new versions of them after updating their conda recipes to remove all their dependencies. Will test that out.

With that I think of this meta package as being essentially a plug-in to Ska3. Of course it won't work if you don't have ska3-core installed, but do we care? My feeling is no.

Understood. Though I did think that a good point that came up for me from the discussion with Javier is that if we update ska3-core, we probably need to test and cut a new version of ska3-perl anyway (because changes in the core packages can conflict or change what ends up in ska3-perl made from ska3-perl-latest). Because of that, I don't feel strongly that keeping ska3-core out of ska3-perl saves us much (still need to do the process on an update), but also fine to strip it out again.

If we take this approach then I think (??) that the current combine_arch.py will generate the correct file out of the box and we're done and having something simple to document/maintain and reproducible.

Well, technically the script now puts out something called ska3-core at the top (and lives in the ska3-core directory), so it either needs a few additional tiny tweaks or documented steps... but will get the ducks in a row.

@javierggt
Copy link
Contributor

javierggt commented Nov 1, 2020

I guess we understand "simplicity" differently.

What I suggested is entirely reproducible in an automated way, and required:

  • no change in the current code,
  • updating ska3-perl whenever ska3-core is updated, which might be needed anyway.

Leaving out ska3-core from the dependencies appears to decouple the two packages so you can update one and not the other, but in reality there will be implicit dependencies, so ska3-perl might need updating whenever ska3-core is updated anyway. Explicit is better than implicit, and it does not increase complexity significantly.

I don't know why Jean had to manually add packages in the end. Were they not already in the input environments?

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 1, 2020

I don't know why Jean had to manually add packages in the end. Were they not already in the input environments?

I was pretty sure they got excluded because they were ska packages and the current ska3-core/combine_arch is set to exclude ska packages via the skare3_tools packages mechanism. So the simplest thing would be to modify this combine_arch draft script to not exclude packages via that mechanism when a subtracting off an environment supplied by the subtract-env option (it shouldn't do both).

I'm also still not sure if the best plan is to make combine_arch perfect or just exactly capture what we did (like how to make ska3-flight) in a separate script / gist.

@taldcroft
Copy link
Member

About the ska3-core, I got misled by the commit where ska3-core=2020.13+shiny was added by hand. Agreed that this is fine if it just comes out of the process from the existing code. Sorry for causing confusion.

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 1, 2020 via email

@javierggt
Copy link
Contributor

I was pretty sure they got excluded because they were ska packages and the current ska3-core/combine_arch is set to exclude ska packages via the skare3_tools packages mechanism. So the simplest thing would be to modify this combine_arch draft script to not exclude packages via that mechanism when a subtracting off an environment supplied by the subtract-env option (it shouldn't do both).

Makes sense, and I would agree with that.

Strictly speaking, we could do away with the skare3_tools.packages option and create ska3-core by installing ska3-flight-latest and subtracting ska3-core-latest. This means the procedure would be the same for both ska3-core and ska3-perl, and all the arbitrariness is absorbed in the creation of ska3-*-latest. Then, if you add ska3-core-latest to the dependencies of ska3-perl-latest, you get a ska3-core dependency in the end.

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 2, 2020

I haven't checked, will your version RC rewriting stuff work to update the ska3-core version as a dependency?

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 2, 2020

I suppose it is set to do that in ska3-flight already but wasn't sure where that was configured so it would work in a new metapackage like ska3-perl.

@javierggt
Copy link
Contributor

javierggt commented Nov 2, 2020

I haven't checked, will your version RC rewriting stuff work to update the ska3-core version as a dependency?

no, but it would be an easy addition. I would add something that replaces all appearances of ska3-*-latest by ska3-* of the same version being generated. This would remove some arbitrary steps:

  • one would not have to remove ska3-core-latest by hand,
  • we would not have the special cases of packages in ska3_tools.packages not in ska3-flight (sherpa et al.)

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 2, 2020

I'm still not sure that ska3-core in ska3-perl wins us much. We'd add ska3-core-latest to ska3-perl-latest for testing, but would still need a manual step (or exception/special case in the code) to add ska3-core-latest (or ska3-core at a version to be magically updated) to ska3-perl.

@javierggt
Copy link
Contributor

javierggt commented Nov 2, 2020

actually... ska3-core would appear in both the ska3-flight and ska3-core environments, so by subtracting them it would not be in the final ska3-flight env. But still, one can add exceptions to ska3-* packages (to not subtract them, for example).

@javierggt
Copy link
Contributor

My suggestion is to merge this, and I will add the option to handle ska3-*.

We all agree the process should be straight-forward and reproducible, and it is going to be faster to implement it than to discuss it. Then we can discuss based on the implementation.

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 2, 2020

Sure. I'll just clean up that one part that Tom called out as DRY . Then we're left with

  • possibly removing the skare3_tools packages mechanism altogether, setting it by option, or setting it to work when subtract-env not supplied
  • adding an exception to the subtracting for ska3- packages... (though we don't want ska3-perl-latest as a dependence of ska3-perl... so this needs to know what metapackage you are trying to make).
  • adding some way to label the created metapackage
  • maybe moving this script out of ska3-core

@jeanconn jeanconn merged commit 4298cfa into 2020.13+shiny Nov 2, 2020
@jeanconn jeanconn deleted the perl_shiny_rc branch November 2, 2020 13:21
@taldcroft
Copy link
Member

I just did that DRY one.

@taldcroft
Copy link
Member

See 34bdad0.

@taldcroft
Copy link
Member

Sorry I should have just left this alone and let you do it.

@taldcroft
Copy link
Member

Though I will argue my refactor is cleaner.

@jeanconn
Copy link
Contributor Author

jeanconn commented Nov 2, 2020

Haha. I was just going to tell you yours was one step cleaner, but you already took credit...

@taldcroft
Copy link
Member

So you should practice DRY on every script, even ones that you consider to be low-grade utility scripts.

@jeanconn jeanconn mentioned this pull request Nov 2, 2020
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