qiboteam / workflows Goto Github PK
View Code? Open in Web Editor NEWCollection of reusable workflows
Home Page: https://qibo.science/workflows/
Collection of reusable workflows
Home Page: https://qibo.science/workflows/
Also the job evaluate-label
is now repeated three times (even if still in the other org). We should factorize it as well, for maintainability.
It should be: https://qibo.science/workflows/
Workflows inputs allow a description
key.
We already describe extensively the parameters in the docs, but a brief, in-place description might still be useful (but, as said brief).
Import them from qibo
and the other existing repos:
https://github.com/qiboteam/qibo/tree/master/.github/workflows
They should be as little as possible, i.e. reuse them as much as possible.
If you can, use the same one (per-kind) for all repos (e.g. only one unit testing, only one deploying on PyPI).
But try to limit as well the number of inputs: if they are too different, keep multiple different workflows.
Notice qibocal
is the only package using Poetry, at present time, so we might have a separate copy for it, but (as said above), better if we can just support both layouts with minimal branching on the same set of workflows.
For the time being we just introduced them, so it was not a major concern, but now we start seeing syncing issues between workflows and repos using them.
Problem is that we are still developing them, so it is quite normal that during development you iterate faster, but we should make such that callers never use development versions, but instead "named" ones, such we do not need to update them constantly.
Following the example of actions/checkout
and similar actions, we will offer two "lines":
v3.0.2
, according to semverv3
, following a family of major releases
actions/checkout
uses tags also for these, updating them every time something is published. To me, this partially misses the purpose of tags, since you'd like to consider them fixed points in Git historySo, if you want to have an immutable object, just use the fully qualified tag in your workflow, like [email protected]
.
If instead you'd like to receive non-breaking updates, use the less qualified branch v3
.
Unqualified branches like main
will be dropped or reserved to development, and they should not be used by callers.
In particular, we won't have a branch named main
(nor master
, nor trunk
) and just use as default branch the latest vX
branch.
Let's start from v0
, to try a bit the model. We will accept breaking changes in v0
for a transition period, after that we will move to v1
and the first breaking change will directly bump to v2
.
Add a README describing the content of this repository, something like
# Workflows
Collection of reusable workflows for the Qibo Gang organization.
## Currently Available
- publish Next.js website to GitHub Pages [`publish-nextjs-to-ghpages`](./.github/workflows/publish-nextjs-to-ghpages.yaml)
- ...
Update docs of all the reusable workflows.
This issue is linked to #23.
As @alecandido suggested, we could remove the occurrence of inputs.environment
and replace it with a dedicated pip extra in the original packages, called ci
, and then replace these lines:
workflows/.github/workflows/rules.yml
Lines 44 to 51 in d07fa1d
pip install .[${{inputs.pip-extras}}]
pip install .[ci]
It seems that the post load cache venv is forcing all tests in qibo to fail, e.g.:
https://github.com/qiboteam/qibo/actions/runs/8571390230/job/23491514141
We can wait some days and check if github has fixed this issue, otherwise we should consider dropping it.
Sometimes Pylint errors are preventing the whole unit tests to run, possibly hiding some further failures.
While in principle it is fine to have a reasonable code before testing, whenever there are Pylint errors are usually localized to some small portions of the code, and they would not cause the whole unit tests to fail.
I propose to make the two jobs independent, even keeping them inside a single workflow. Moreover, we do not need to run Pylint on all the combinations of matrix on which we run unit tests, it is sufficient to iterate Python versions, while linting errors should not depend on the os/architecture.
Docs are currently broken https://qibogang.github.io/workflows
It seems to me that it would be better to not test on many platforms with poetry install, but rather to generate a wheel on a single one and pip install it, in order to have the same dependency resolution as my users.
For the way it is written, the wheel releasing workflow is essentially a duplicate of the unit tests one, with the addition of building the wheels at the end, and optionally releasing them.
They are also running on the same events.
At this point, it is better to maintain a single workflow, since building the wheels (and not deploying them) never hurts.
We could simplify maintenance a bit.
Just to have a reference to point, and to remind us we should sooner or later take action about this kind of failures:
Error: The template is not valid. qiboteam/workflows/.github/workflows/rules-poetry.yml@main (Line: 52, Col: 16): hashFiles('**/poetry.lock') couldn't finish within 120 seconds.
https://github.com/qiboteam/qibocal/actions/runs/5309540365/jobs/9610320452#step:29:2
Explanation: hashing Poetry lock files is apparently taking too much on Mac machines (most likely because they are slow), and exceeding a GitHub Actions timeout (that's why they are killed).
Since it's happening after tests is not a real problem, but incredibly annoying.
Solutions I see at the moment:
The most relevant issue, pradyunsg/furo#639, has actually been closed by the author yesterday, together with the publication of a new version on PyPI (2023.03.23
).
However, as people have suggested in a comment pradyunsg/furo#639 (reply in thread), the problem still persists even with the new version.
I tested myself that the problem is actually still present.
Because of this, we had to deactivate Poetry's modern installer in #46. E.g.
workflows/.github/workflows/rules-poetry.yml
Lines 45 to 46 in 816e9b1
The moment a fixed wheel will be released, we'll be able to restart using the modern installer.
After qiboteam/qibo#816 only Qibolab will be left without Poetry.
We should review the other minor projects, and check if there is anyone still using the pip workflows, and possibly migrate also that.
Otherwise, I would rather support only a single set of tools for Python packaging, and if there are specific needs local workflows are always available (if there will be a massive need to support setuptools
again, we will reconsider - but only if and when it will happen).
To face the issue of failing uploads (e.g. qiboteam/qibolab#276 (comment)) Codecov now suggests to always use a Codecov token also for public repos.
https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
Our workflows should be already using them, when available:
workflows/.github/workflows/rules.yml
Line 76 in 4f1b0c0
So we should only confirm that we have token set in all repos, to limit upload failures as much as possible.
@Edoardo-Pedicillo there are a few elements that are hard-coded in the new workflow, e.g.
https://github.com/qibogang/workflows/blob/a22b49c1376335b917f49f18d778f3b4263d4605/.github/workflows/deploy-ghpages-latest-stable.yml#L112
where both the base URL, i.e. https://qibogang.github.io/
, and the folder, i.e. qibo/
, are spelled out.
They should be replaced by inputs (in the case of the base URL, you can use https://qibo.science/
as default).
Looking into Pylint I discover they also ship a script called symilar
, to check for copy-pasted code.
I hope this will never detect anything, but since many people are working on these projects I have a preference for more automated tests (and being shipped by Pylint I consider it reliable and maintained, and we would not need any further dep).
Moreover, I'd like to introduce mypy
checks as well, even if as a first step I would make failures opt-in.
Type hints are optional, but also incremental, so mypy
will try to infer as much as possible, and more we'll use consistent types and type hints (as it is happening with dataclass
, that make them mandatory) more useful mypy
checks will be.
Both the workflow with latest&stable
and the basic Sphinx one are making use of the same Sphinx docs compiling job.
Instead of propagating fixes and upgrades from one the other, we should split the common part to a third workflow, and call that one.
At the moment, there is a fake page for this repo:
https://qibogang.github.io/workflows/
but it is not a bad idea to have an actual one.
We could bootstrap an extremely simple page with Next.js as well. In general, we want to:
One alternative is Sphinx, but there is no Python code, and writing ReStructuredText is more of a pain than Markdown.
The other option, and this is an actual one, is to use the native Jekyll running on GitHub, i.e.
docs
top-level with md filesThen my actual proposal for this would be:
qibogang.github.io
to use the one stored here (whenever will be released on main
)We have some simple documentation for the workflows in the docs/
folder. It is missing for this one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.