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

The check for image is now more robust #13556

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Jan 8, 2021

The request to get manifest of the image in GitHub Packages
might randomly return either schma 1 response:

{
"schemaVersion": 1,
"name": "apache/airflow/master-python3.6-ci",
"tag": "470317521",
"architecture": "amd64",
"fsLayers": [
{

Or schema 2 response:

{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 56952,
"digest": "sha256:5c80e2ab289647802affafc5c1efc879fe4f5b559cb7a2a1215868e84b1d6424"
},

In order to check image more reliably we check the status code
of the curl response instead.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@potiuk
Copy link
Member Author

potiuk commented Jan 8, 2021

Looks like the response of the API call to check if image is available (retrieving manifest) sometimes returns digest of the image and sometimes it does not :(

Example here: https://github.com/apache/airflow/pull/13409/checks?check_run_id=1665801504#step:5:239

Checking for quoted image tag should help.

@potiuk
Copy link
Member Author

potiuk commented Jan 8, 2021

🤦 🤦
It turns out that sometime we get schema 2 answer:
https://github.com/apache/airflow/pull/13556/checks?check_run_id=1666011321#step:5:403

{
     "schemaVersion": 2,
     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
     "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 56952,
        "digest": "sha256:5c80e2ab289647802affafc5c1efc879fe4f5b559cb7a2a1215868e84b1d6424"
     },

And sometimes schema 1 answer:
https://github.com/apache/airflow/runs/1665801504?check_suite_focus=true#step:5:240

  {
     "schemaVersion": 1,
     "name": "apache/airflow/master-python3.6-ci",
     "tag": "470317521",
     "architecture": "amd64",
     "fsLayers": [
        {

🤦 🤦 🤦 🤦 🤦 🤦 🤦 🤦 🤦

@potiuk
Copy link
Member Author

potiuk commented Jan 8, 2021

Luckily in both cases same error:

{"errors":[{"code":"MANIFEST_UNKNOWN","message":"Docker image reference master-python3.6-ci:470415985 not found under repo \"apache\""}]}

@potiuk potiuk force-pushed the more-robust-check-for-image branch 2 times, most recently from 267c6e0 to bb4cff3 Compare January 8, 2021 01:14
@potiuk
Copy link
Member Author

potiuk commented Jan 8, 2021

Looks red but it's quarantined test.

The request to get manifest of the image in GitHub Packages
might randomly return either schma 1 response:

{
     "schemaVersion": 1,
     "name": "apache/airflow/master-python3.6-ci",
     "tag": "470317521",
     "architecture": "amd64",
     "fsLayers": [
        {

Or schema 2 response:

{
     "schemaVersion": 2,
     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
     "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 56952,
        "digest": "sha256:5c80e2ab289647802affafc5c1efc879fe4f5b559cb7a2a1215868e84b1d6424"
     },

In order to check image more reliably we check the status code
of the curl response instead.
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Jan 8, 2021
@github-actions
Copy link

github-actions bot commented Jan 8, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk potiuk merged commit dc7d0a6 into apache:master Jan 8, 2021
@potiuk potiuk deleted the more-robust-check-for-image branch January 8, 2021 07:21
kaxil pushed a commit that referenced this pull request Jan 21, 2021
The request to get manifest of the image in GitHub Packages
might randomly return either schma 1 response:

{
     "schemaVersion": 1,
     "name": "apache/airflow/master-python3.6-ci",
     "tag": "470317521",
     "architecture": "amd64",
     "fsLayers": [
        {

Or schema 2 response:

{
     "schemaVersion": 2,
     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
     "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 56952,
        "digest": "sha256:5c80e2ab289647802affafc5c1efc879fe4f5b559cb7a2a1215868e84b1d6424"
     },

In order to check image more reliably we check the status code
of the curl response instead.

(cherry picked from commit dc7d0a6)
kaxil pushed a commit to astronomer/airflow that referenced this pull request Apr 23, 2021
The request to get manifest of the image in GitHub Packages
might randomly return either schma 1 response:

{
     "schemaVersion": 1,
     "name": "apache/airflow/master-python3.6-ci",
     "tag": "470317521",
     "architecture": "amd64",
     "fsLayers": [
        {

Or schema 2 response:

{
     "schemaVersion": 2,
     "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
     "config": {
        "mediaType": "application/vnd.docker.container.image.v1+json",
        "size": 56952,
        "digest": "sha256:5c80e2ab289647802affafc5c1efc879fe4f5b559cb7a2a1215868e84b1d6424"
     },

In order to check image more reliably we check the status code
of the curl response instead.

(cherry picked from commit dc7d0a6)
(cherry picked from commit 0aaa896)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants