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

aws-test: Add a rhcos_test=smoketested tag #314

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

cgwalters
Copy link
Member

This way the installer can do a query for those.

@cgwalters
Copy link
Member Author

(Untested)

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 25, 2018
@@ -59,6 +59,9 @@ node(NODE) {
fi

cp ${dirpath}/aws-${AWS_REGION}-smoketested.json ${images}/aws-${AWS_REGION}-tested.json
aws ec2 create-tags \
--resources \${ami_intermedia} \
--tags rhcos_test=smoketested
Copy link
Member

Choose a reason for hiding this comment

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

This is bikeshed, though maybe this should just be tested? Given that right now we use smoketested to refer to the first kola run in the cloud job.

Copy link
Member

Choose a reason for hiding this comment

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

This is bikeshed, though maybe this should just be tested?

+1 to generic names until we have several test classes to distinguish between. If we already have plans for more specific tests, than +1 to namespacing with smoke now ;).

Copy link
Member

Choose a reason for hiding this comment

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

Beating the horse further...we discussed tagging in #201 and #150

There seemed to be consensus around #201 (comment)

While that is about the container tags, there was agreement that the container tags and image tags should be the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK right so...based on that comment you're saying the tag should be alpha right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated with that change ⬇️

Jenkinsfile.aws-test Outdated Show resolved Hide resolved
This way the installer can do a query for those.
@jlebon
Copy link
Member

jlebon commented Sep 26, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2018
@openshift-merge-robot openshift-merge-robot merged commit deb0971 into openshift:master Sep 26, 2018
@wking wking mentioned this pull request Oct 3, 2018
@wking
Copy link
Member

wking commented Oct 3, 2018

Is this working? Searching now, I don't see any alpha-tagged AMIs from the CI account:

$ AWS_PROFILE=ci aws sts get-caller-identity --query Account --output text
460538899914
$ AWS_PROFILE=ci AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-images --filter Name=tag:rhcos_tag,Values=alpha --output json
{
    "Images": []
}
$ AWS_PROFILE=ci AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-images --filter 'Name=name,Values=rhcos*' --query 'sort_by(Images, &CreationDate)[].Name' --output json
[
    "rhcos_dev_5e68e84-hvm", 
    "rhcos_dev_31c37ee-hvm", 
    "rhcos_dev_6152149-hvm", 
    "rhcos_dev_f54819e-hvm", 
    "rhcos_dev_d6f5511-hvm", 
    "rhcos_dev_bb37fd6-hvm", 
    "rhcos_dev_859effb-hvm", 
    "rhcos_dev_7b23b3e-hvm", 
    "rhcos_dev_720aa72-hvm", 
    "rhcos_dev_3e4adc1-hvm", 
    "rhcos_dev_601a8a9-hvm", 
    "rhcos_dev_d96fb50-hvm", 
    "rhcos_dev_62d22c1-hvm", 
    "rhcos_dev_3b8f6c0-hvm", 
    "rhcos_dev_622abd5-hvm", 
    "rhcos_dev_c1ca7d1-hvm", 
    "rhcos_dev_c427d12-hvm", 
    "rhcos_dev_5582faf-hvm", 
    "rhcos_dev_c9a6bb4-hvm", 
    "rhcos_dev_d68316b-hvm", 
    "rhcos_dev_de0a1f7-hvm", 
    "rhcos_dev_2e74ae4-hvm", 
    "rhcos_dev_7ca7835-hvm", 
    "rhcos_dev_6930a92-hvm", 
    "rhcos_dev_2501688-hvm", 
    "rhcos_dev_22740ad-hvm", 
    "rhcos_dev_5ddeccf-hvm", 
    "rhcos_dev_3a7887d-hvm", 
    "rhcos_dev_d7e9c37-hvm", 
    "rhcos_dev_7536381-hvm", 
    "rhcos_dev_3089f99-hvm", 
    "rhcos_dev_c0f6e2b-hvm", 
    "rhcos_dev_0de27f7-hvm", 
    "rhcos_dev_d379d2b-hvm", 
    "rhcos_dev_4.0.6271-hvm", 
    "rhcos_dev_4.0.6272-hvm", 
    "rhcos_dev_4.0.6275-hvm", 
    "rhcos_dev_4.0.6276-hvm", 
    "rhcos_dev_4.0.6295-hvm", 
    "rhcos_dev_4.0.6457-hvm", 
    "rhcos_dev_4.0.6464-hvm", 
    "rhcos_dev_4.0.6468-hvm", 
    "rhcos_dev_4.0.6469-hvm"
]

It's also possible that Name=tag:rhcos_tag,Values=alpha is not the right incantation.

wking added a commit to wking/openshift-installer that referenced this pull request Oct 3, 2018
openshift/os@76b3ae5d (aws-test: Add a rhcos_test=smoketested tag,
2018-09-25, openshift/os#314) started adding rhcos_tag=alpha tags to
tested AMIs.  The likely plan for RHCOS tagging is [1], although they
don't have stable docs for that yet.  With this commit, we allow the
user to specify whichever channel they want, and we search for that
tag.  If they give us nonsense, we'll now hit AWS, see no images in
the nonsense channel, and report that back to the caller.

Users that don't care about release channels and just want to use the
latest image regardless of channel, can set 'channel' to an empty
string.

[1]: openshift/os#201 (comment)
@miabbott
Copy link
Member

miabbott commented Oct 5, 2018

@wking I think the syntax might be off based on this #322 and some reading of aws ec2 describe-images help

$ aws ec2 describe-images --filters "Name=tag:rhcos_tag,Values=alpha" --output json
{                                                    
    "Images": [                                                                                
        {                                                                                      
            "Architecture": "x86_64",                                                          
            "CreationDate": "2018-09-27T18:14:11.000Z",                                        
            "ImageId": "ami-01be9707253b2d46d",                                                                                                                                                                    
            "ImageLocation": "531415883065/rhcos_dev_0de27f7-hvm",                                                         
            "ImageType": "machine",                                
            "Public": true,                                       
            "OwnerId": "531415883065",                             
            "State": "available",                                                              
            "BlockDeviceMappings": [                               
                {                                                                       
                    "DeviceName": "/dev/xvda",                     
                    "Ebs": {                                                                                                                                                                                       
                        "Encrypted": false,                                                                                
                        "DeleteOnTermination": true,               
                        "SnapshotId": "snap-0617705761c5d0050",    
                        "VolumeSize": 8,                                                           
                        "VolumeType": "gp2"
                    }
                },
                {
                    "DeviceName": "/dev/xvdb",
                    "VirtualName": "ephemeral0"
                }
            ],
            "Description": "Red Hat CoreOS 4.0.6225 (0de27f731fcdedd767ea99e3b341065146b570628bf9d76d3d6837eb524550da)",
            "EnaSupport": true,
            "Hypervisor": "xen",
            "Name": "rhcos_dev_0de27f7-hvm",
            "RootDeviceName": "/dev/xvda",
            "RootDeviceType": "ebs",
            "SriovNetSupport": "simple",
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "rhcos_dev_0de27f7-hvm"
                },
                {
                    "Key": "ostree_version",
                    "Value": "4.0.6225"
                },
                {
                    "Key": "ostree_commit",
                    "Value": "0de27f731fcdedd767ea99e3b341065146b570628bf9d76d3d6837eb524550da"
                },
                {
                    "Key": "rhcos_tag",
                    "Value": "alpha"
                }
            ],
            "VirtualizationType": "hvm"
        },
...

@wking
Copy link
Member

wking commented Oct 5, 2018

That looks like what I ran ;). But guessing based on your success, it looks like the tags are only being pushed to the rh-dev account:

$ AWS_PROFILE=rh-dev AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-images --filters "Name=tag:rhcos_tag,Values=alpha" --query 'sort_by(Images, &CreationDate)[-1].Name' --output text
rhcos_dev_4.0.6562-hvm
$ AWS_PROFILE=ci AWS_DEFAULT_REGION=us-east-1 aws ec2 describe-images --filters "Name=tag:rhcos_tag,Values=alpha" --query 'sort_by(Images, &CreationDate)[-1].Name' --output text
None
$ AWS_PROFILE=rh-dev aws sts get-caller-identity --query Account --output text
531415883065
$ AWS_PROFILE=ci aws sts get-caller-identity --query Account --output text
460538899914

I thought these AMIs were public? Are AMI tags account-specific? If so, that basically sinks this idea, as far as I can tell.

@miabbott
Copy link
Member

miabbott commented Oct 5, 2018

That looks like what I ran ;). But guessing based on your success, it looks like the tags are only being pushed to the rh-dev account:

Heh...yeah, didn't pay enough attention.

We do make the AMI public here: https://github.com/openshift/os/blob/master/Jenkinsfile.aws-test#L89-L91

And according to the docs here, it looks like we are doing the right thing.

@wking Could you open a separate issue for what you are seeing, so we can take this out of PR comments? 😄

@miabbott
Copy link
Member

miabbott commented Oct 5, 2018

FWIW

$ aws ec2 describe-image-attribute --image-id ami-0a08f82608c65f0bc --attribute launchPermission
ami-0a08f82608c65f0bc
LAUNCHPERMISSIONS       all

¯_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants