Skip to content

Rebase "Compose apps" on 2020.5+fio#8

Merged
doanac merged 12 commits intomasterfrom
compose-apps
May 19, 2020
Merged

Rebase "Compose apps" on 2020.5+fio#8
doanac merged 12 commits intomasterfrom
compose-apps

Conversation

@mike-sul
Copy link
Copy Markdown
Contributor

No description provided.

doanac added 11 commits May 15, 2020 14:50
This function is growing in complexity and will get worse when we
add callback functionality. This will break things up in a way that
will also make it easier to use C++ constructor/destructor logic

Signed-off-by: Andy Doan <[email protected]>
This makes things a little less tedious

Signed-off-by: Andy Doan <[email protected]>
This class has grown to the point where the interface intended to be
used by main.cc and the implementation are getting blurred. There's more
that could be cleaned up here, but this is an improvement.

Signed-off-by: Andy Doan <[email protected]>
Lock files aren't flexible enough for many users. This approach allows a
user to have more fine-grained control of when things happen. A callback
program could then decide if it was an okay time to do a "download". If
not, it could simply block until it was ready.

Signed-off-by: Andy Doan <[email protected]>
Move update checking into the LiteClient and wrap it with a callback

Signed-off-by: Andy Doan <[email protected]>
This logic is used by both the fetch and install methods we'll be
creating.

Signed-off-by: Andy Doan <[email protected]>
This required a fix to log_info_target. The old way wasn't great because
it would show docker-apps to platforms that don't support them. In order
to fix this, log_info_targets was added to our ifdef logic so it can be
done better.

Signed-off-by: Andy Doan <[email protected]>
@mike-sul mike-sul requested a review from doanac May 15, 2020 14:04
@mike-sul mike-sul force-pushed the compose-apps branch 2 times, most recently from 8bd3377 to d3a2393 Compare May 15, 2020 14:23
Signed-off-by: Andy Doan <[email protected]>
Signed-off-by: Mike Sul <[email protected]>
Comment thread src/helpers.cc
}
}

static __attribute__((constructor)) void init_pacman() {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not necessary to do static __attribute__((constructor)) in case of an executable, just PackageManagerFactory::registerPackageManager can be called. The original idea was to be able to "inject" a new package manager implemented and delivered as a shared library.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This just gives me a fool-proof way to make sure it gets called at initialization. Otherwise the LiteClient constructor needs to call registerPackageManager, but only if -DBUILD_DOCKERAPP .

@doanac
Copy link
Copy Markdown
Member

doanac commented May 18, 2020

@mike-sul - so you think this is ready to merge?

@mike-sul
Copy link
Copy Markdown
Contributor Author

I cannot verify it from end-to-end perspective as it requires creating a 'docker_compose_apps' target instead of 'docker_apps' on the backend. Also, we might wanna update lmp-device-register to configure sota.toml with the 'docker compose' variables instead of 'docker app'.

@doanac
Copy link
Copy Markdown
Member

doanac commented May 18, 2020

If you want to give it a spin, you can enable it in your factory with this:

https://source.foundries.io/factories/andy-corp/ci-scripts.git/commit/?id=211e276a4273e4282b2481507e5f2c0c6955a3cf

that will continue to publish the old docker apps and also this now compose app.

And once we get things tested in our factories, yes, we'll update the sota.toml generation to use this instead.

@mike-sul
Copy link
Copy Markdown
Contributor Author

that will continue to publish the old docker apps and also this now compose app.

another missing piece for me is docker-compose download command.

@doanac
Copy link
Copy Markdown
Member

doanac commented May 18, 2020

another missing piece for me is docker-compose download command.

Good catch. This needs to be merged into meta-lmp:

doanac/meta-lmp@c70d45f

@mike-sul
Copy link
Copy Markdown
Contributor Author

mike-sul commented May 18, 2020

aktually this can be merged as it does not interfere with the docker app standalone package manager.
I actually tested this branch on my RPi with the default package manager and it worked well.

@doanac
Copy link
Copy Markdown
Member

doanac commented May 18, 2020

you want to hold off while we re-work the download function to be in aklite, or should do you want to do that in a new PR?

@mike-sul
Copy link
Copy Markdown
Contributor Author

you want to hold off while we re-work the download function to be in aklite, or should do you want to do that in a new PR?

This PR has the callback implementation which is agnostic to the package manager type, so if we merge it people can give it try. So, yes, I prefer to do the download function in a new PR.

@mike-sul
Copy link
Copy Markdown
Contributor Author

@doanac so merge or not to merge :)?

@doanac
Copy link
Copy Markdown
Member

doanac commented May 19, 2020

I forgot this stuff depended on the callbacks stuff. However, there's only one commit in the "callback" patches that does callbacks. The rest is code cleanup.

@doanac doanac merged commit bedf8ac into master May 19, 2020
@doanac doanac deleted the compose-apps branch May 19, 2020 14:42
@mike-sul
Copy link
Copy Markdown
Contributor Author

@doanac thanks!

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.

2 participants