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

#36 - Adding the ability to retrieve cached wheel files from poetry cache #37

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

JeffreyRoss
Copy link
Collaborator

@JeffreyRoss JeffreyRoss commented Mar 5, 2024

Orphedomos orchestrates and executes docker builds as part of a maven process. It has a phase where it verifies the docker environment. The goal of this ticket to extend the habushu logic that retrieves cached wheel files into orphedomos for the purpose of establishing python environments within a given docker image. Extending the retrieveWheels logic will allow orphedomos to define wheel dependencies needed for a docker image.

By extending this mojo the following configuration is now available:

wheelDependencies
Optional set of wheel dependencies to retrieve from poetry cache. This allows previously cached external wheel dependencies to be copied into a given target directory if it exists in poetry cache. This logic depends on wheels to have first been cached by cacheWheels habushu-maven-plugin configuration and executes during the VALIDATE maven phase. Warnings will be logged if the specified wheel isn't found.

  <plugin>
      <groupId>org.technologybrewery.orphedomos</groupId>
      <artifactId>orphedomos-maven-plugin</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <executions>
          <execution>
              <id>retrieve-wheels</id>
              <phase>validate</phase>
              <goals>
                  <goal>retrieve-wheels</goal>
              </goals>
              <configuration>
                  <wheelDependencies>
                      <wheelDependency>
                          <artifactId>foundation-core-python</artifactId>
                          <targetDirectory>${wheelOutputDirectory}</targetDirectory>
                      </wheelDependency>
                  </wheelDependencies>
              </configuration>
          </execution>
      </executions>
  </plugin>

<dependency>
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.10.1-SNAPSHOT</version>

Choose a reason for hiding this comment

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

S: Do we still want this pointing to a snapshot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the snapshot is the only version that has the functionality needed at this time. This will be updated in the future to a release version when it's published.

*/
@Mojo(name = "retrieve-wheels", defaultPhase = LifecyclePhase.VALIDATE)
public class RetrieveCachedWheelsMojo extends RetrieveWheelsMojo {

Copy link
Contributor

@jacksondelametter jacksondelametter Mar 5, 2024

Choose a reason for hiding this comment

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

It looks like you are just extending a new mojo in Orphedomos from Habushu but since its identical, why not just use the mojo from Habushu since your not adding any new functionality?

Choose a reason for hiding this comment

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

I imagine this is done to get it to run in the Validate lifecycle

Copy link
Collaborator Author

@JeffreyRoss JeffreyRoss Mar 5, 2024

Choose a reason for hiding this comment

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

Originally Habushu's logic insisted on the calling project's packaging to be "habushu" only in order to execute otherwise it would not run. My particular use cases in aissemble are orphedomos projects. However, the 2nd code change was needed to bypass this packaging logic so actually I think I could probably achieve my goal without this orphedomos change. Let me consider.

Copy link
Collaborator Author

@JeffreyRoss JeffreyRoss Mar 5, 2024

Choose a reason for hiding this comment

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

Yes it looks like it'll be best for this functionality to be extended in orphedomos so i'll leave it here. @cpointe-ibllanos @jacksondelametter

<dependency>
<groupId>org.technologybrewery.habushu</groupId>
<artifactId>habushu-maven-plugin</artifactId>
<version>2.10.1-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a good idea to add a property for the version in pom file since I see this changing quite a bit!

Copy link
Collaborator Author

@JeffreyRoss JeffreyRoss Mar 5, 2024

Choose a reason for hiding this comment

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

Under normal circumstances a variable would make sense but this particular instance is the only instance of habushu in orphedomos and once habushu releases the version will be removed.

@JeffreyRoss JeffreyRoss merged commit 34ac2b5 into dev Mar 5, 2024
@JeffreyRoss JeffreyRoss deleted the 36 branch March 5, 2024 21:18
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.

4 participants