Skip to content

Conversation

@bd233
Copy link
Contributor

@bd233 bd233 commented Oct 27, 2021

This PR is based on #5018, and applies the modification of #5291, and fixes the issues raised in #5291.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 27, 2021

Hi @bd233. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 27, 2021
@openshift-ci openshift-ci bot requested review from jhixson74 and jstuever October 27, 2021 04:23
@bd233 bd233 force-pushed the alibabacloud-recommitted branch 2 times, most recently from eed122e to ccdc690 Compare October 27, 2021 11:39
@kwoodson
Copy link

When I attempted to run this I received the following error:

ERROR Error: Invalid value for input variable      
ERROR                                              
ERROR   on /tmp/openshift-install-cluster-063195056/terraform.alibabacloud.auto.tfvars.json line 17: 
ERROR   17:   "ali_extra_tags": [                  
ERROR   18:     {                                  
ERROR   19:       "Value": "owned",                
ERROR   20:       "Key": "kubernetes.io/cluster/test-6w5nd" 
ERROR   21:     },                                 
ERROR   22:     {                                  
ERROR   23:       "Value": "ISV Integration",      
ERROR   24:       "Key": "OCP"                     
ERROR   25:     }                                  
ERROR   26:   ],                                   
ERROR                                              
ERROR The given value is not valid for variable "ali_extra_tags": map of string 
ERROR required.                                    

I believe this is due to the mismatch in types. The pkg/tfvars/alibabacloud/alibabacloud.go has this:

ExtraTags             []alibabacloudprovider.Tag `json:"ali_extra_tags,omitempty"`

The terraform definition of ali_extra_tags is a map(string) in data/data/alibabacloud/variables-alibabacloud.tf.

The list of alibabacloudprovider.Tag mismatched on the terraform variable type map(string). This causes the merge that happens at the top of the terraform files to fail (bootstrap/main.tf, cluster/main.tf).

@patrickdillon
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 27, 2021
Copy link
Contributor

Choose a reason for hiding this comment

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

The gofmt test is failing after removing this line. See: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_installer/5333/pull-ci-openshift-installer-master-gofmt/1453476031779311616

Can you run gofmt on this file or fix the formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can.

@patrickdillon
Copy link
Contributor

Thanks for posting this. I am still working on reviewing these most recent changes.

@bd233 bd233 force-pushed the alibabacloud-recommitted branch from ccdc690 to f256579 Compare October 28, 2021 08:24
@bd233
Copy link
Contributor Author

bd233 commented Oct 28, 2021

When I attempted to run this I received the following error:

ERROR Error: Invalid value for input variable      
ERROR                                              
ERROR   on /tmp/openshift-install-cluster-063195056/terraform.alibabacloud.auto.tfvars.json line 17: 
ERROR   17:   "ali_extra_tags": [                  
ERROR   18:     {                                  
ERROR   19:       "Value": "owned",                
ERROR   20:       "Key": "kubernetes.io/cluster/test-6w5nd" 
ERROR   21:     },                                 
ERROR   22:     {                                  
ERROR   23:       "Value": "ISV Integration",      
ERROR   24:       "Key": "OCP"                     
ERROR   25:     }                                  
ERROR   26:   ],                                   
ERROR                                              
ERROR The given value is not valid for variable "ali_extra_tags": map of string 
ERROR required.                                    

I believe this is due to the mismatch in types. The pkg/tfvars/alibabacloud/alibabacloud.go has this:

ExtraTags             []alibabacloudprovider.Tag `json:"ali_extra_tags,omitempty"`

The terraform definition of ali_extra_tags is a map(string) in data/data/alibabacloud/variables-alibabacloud.tf.

The list of alibabacloudprovider.Tag mismatched on the terraform variable type map(string). This causes the merge that happens at the top of the terraform files to fail (bootstrap/main.tf, cluster/main.tf).

Okay, I also found this problem, and I have submitted a commit to fix it.
In addition, I found some CI tests that failed, which I am dealing with them.

@bd233
Copy link
Contributor Author

bd233 commented Oct 28, 2021

/retest-required

@kwoodson
Copy link

@patrickdillon @bd233 The latest pull request has fixed the tagging issue previously noted. I was able to install using this PR.

@patrickdillon
Copy link
Contributor

/retest

@patrickdillon
Copy link
Contributor

All of the tests are failing/failing to build because you need a rebase. fmt was removed from pkg/tfvars/aws/aws.go in 6fc25a6 so this line is causing an error: 464c8ae#diff-9c4cee7cc715858abb38823e9409c61a65d8fdabedc104d5d69bf62d38e4bd1bR148

Feel free to add fmt back to that file after you rebase.

@patrickdillon
Copy link
Contributor

It is not clear to me that the feedback regarding the destroy code has been completely address, in particular:
#5291 (comment) and #5291 (comment)

If there is going to be further work needed for the destroy code, I wonder if it might be a good idea to separate the destroy code into a separate PR so that we don't block the rest of the code in this PR.

object := "bootstrap.ign"
signURL, err := client.GetOSSObjectSignURL(bucket, object)
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to wrap all of these error messages before returning them.


masters, err := mastersAsset.Machines()
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to wrap all of these error messages before returning them.

}
workers, err := workersAsset.MachineSets()
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to wrap all of these error messages before returning them.


natGatewayZones, err := client.ListEnhanhcedNatGatewayAvailableZones()
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to wrap all of these error messages before returning them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll fix them. But I have a doubt, under what circumstances should error messages be wrapped? I notice that many of the above parts are returned directly. Understanding this, I can better fix such errors.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing those. It is always a good idea to wrap errors, but in this case, it is necessary because there is a large function Generate that can return errors at many different points. If you don't wrap the error you will not know which part of the code generated the error if you are are trying to debug/troubleshoot.

@bd233
Copy link
Contributor Author

bd233 commented Oct 29, 2021

It is not clear to me that the feedback regarding the destroy code has been completely address, in particular: #5291 (comment) and #5291 (comment)

If there is going to be further work needed for the destroy code, I wonder if it might be a good idea to separate the destroy code into a separate PR so that we don't block the rest of the code in this PR.

I'm sorry to confuse you. I think I should explain our plan here:
What will be updated in the follow-up PR (we will submit this part next week):

  1. Destroy cluster part, #5291 (comment) and #5291 (comment)
  2. ResourceGroupID is required
  3. Support the existing VPC and PrivateZone
  4. Before deleting a cluster, check and turn off the deletion protection of SLB and ECS

Problems fixed in the current PR (will be submitted today):

  1. use a well-known Tag for VSwitch and Security group in manifests

If there are any problems that block the merging or need us to solve, please let me know. thanks.

@bd233 bd233 force-pushed the alibabacloud-recommitted branch from f256579 to da421e8 Compare October 29, 2021 10:28
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to switch the next template back from {{- else if -> {{- if

This is causing all of the platform tests to fail (e.g. e2e-aws)

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to switch the next template back from {{- else if -> {{- if

@patrickdillon
Copy link
Contributor

It is not clear to me that the feedback regarding the destroy code has been completely address, in particular: #5291 (comment) and #5291 (comment)
If there is going to be further work needed for the destroy code, I wonder if it might be a good idea to separate the destroy code into a separate PR so that we don't block the rest of the code in this PR.

I'm sorry to confuse you. I think I should explain our plan here: What will be updated in the follow-up PR (we will submit this part next week):

  1. Destroy cluster part, #5291 (comment) and #5291 (comment)
  2. ResourceGroupID is required
  3. Support the existing VPC and PrivateZone
  4. Before deleting a cluster, check and turn off the deletion protection of SLB and ECS

Problems fixed in the current PR (will be submitted today):

  1. use a well-known Tag for VSwitch and Security group in manifests

If there are any problems that block the merging or need us to solve, please let me know. thanks.

This is fine. We want to merge as much of the present PR as we can as quickly as we can. This PR is still not ready to merge, so we can add to it. But If we get the rest of the PR ready to merge but destroy is not ready, we don't want to block this PR on destroy. Instead we could remove destroy and put it in a new PR and merge this one. We can figure that out next week.

@kwoodson
Copy link

@bd233 Here is an example from the output from the new tags:

...
        providerSpec:
          value:
            apiVersion: alibabacloudmachineproviderconfig.openshift.io/v1beta1
            credentialsSecret:
              name: alibabacloud-credentials
            dedicatedHostId: ""
            imageId: m-0xia2ofzd15xb3jb4ji2
            instanceName: test-6bh8w-worker
            instanceType: ecs.g6.large
            ioOptimized: optimized
            kind: AlibabaCloudMachineProviderConfig
            metadata:
              creationTimestamp: null
            ramRoleName: test-6bh8w-role-worker
            regionId: us-east-1
            resourceGroupId: rg-acfnxrgr6qtm3mq
            securityGroupId: ""
            securityGroups:
            - tags:
              - Key: kubernetes.io/cluster/test-6bh8w
                Value: owned
              - Key: OCP
                Value: ISV Integration
              - Key: Name
                Value: test-6bh8w-sg-worker
            systemDiskCategory: cloud_essd
            systemDiskSize: 120
            tags:
            - Key: kubernetes.io/cluster/test-6bh8w
              Value: owned
            - Key: OCP
              Value: ISV Integration
            userDataSecret:
              name: worker-user-data
            vSwitch:
              tags:
              - Key: kubernetes.io/cluster/test-6bh8w
                Value: owned
              - Key: OCP
                Value: ISV Integration
              - Key: Name
                Value: test-6bh8w-vswitch-us-east-1a
            zoneId: us-east-1a

Copy link
Contributor

Choose a reason for hiding this comment

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

avaliabel -> available

@bd233 bd233 force-pushed the alibabacloud-recommitted branch 2 times, most recently from 245f042 to c8c38d3 Compare November 1, 2021 13:42
@bd233
Copy link
Contributor Author

bd233 commented Nov 1, 2021

@patrickdillon @kwoodson I have removed the pkg/destroy commit and updated the vendor. Please continue to review the code.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2021
Adds the Alibaba platform and validation to types package. Also
adds supporting files for explain.
@bd233 bd233 force-pushed the alibabacloud-recommitted branch from 7bed713 to 3437897 Compare November 3, 2021 13:13
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 3, 2021
@kwoodson
Copy link

kwoodson commented Nov 3, 2021

@bd233 @dongchen126

One simple update remaining to this file:
https://github.com/openshift/installer/pull/5333/files#diff-d8695174d83d5a37969524935693f06fda5f8f2c947f3d979a7162dca4721f64R8

Should be:

	machineapi "github.com/openshift/api/machine/v1beta1"

bd233 added 6 commits November 3, 2021 23:57
Adds preliminary assets for the Alibaba platform: cluster,
install config, machines, manifests, quota, rhcos.

Alibaba: fix: unset credential environment variables

Remove the section that sets the credential environment variables.

Alibaba: fix: remove cluster secret

Supposed to be operating in manual mode only, remove the section to create cluster credentials for CCO

Alibaba: fix: use metadata.client whenever possible

1. Remove unused BaseDomain in metadata
2. In other components, use the client stored in metadata as much as possible

Alibaba: fix: reconstruction GenerateIgnitionShim function

1. Move GenerateIgnitionShim function to the pkg/asset/ignition/bootstrap package
2. Rename to GenerateIgnitionShimWithCertBundle
3. Modify the corresponding test file
Adds Terraform plugin, tfvars and stages for Alibaba.

Alibaba: fix: remove unused attributes for TFVarsSources

Remove some unused attributes for TFVarsSources
Adds Terraform configurations for the Alibaba platform.

Alibaba: fix: add control_plane_ips output item

Add control_plane_ips output item for cluster module

Alibaba: fix: replace Tag with ExtraTags for tfvars config

Replace Tag with ExtraTags for tfvars config, and modify json field to ali_extra_tags stay consistent with other platforms
This commit was produced by running , , and
all modules verified.

Signed-off-by: sunhui <[email protected]>
Add Tags info for VSwitch and SecurityGroups to machines.
Alibaba provider will use these Tags to find the VSwitch and security group after running the terraform runs,
And use them to create the ECS instances.

Signed-off-by: sunhui <[email protected]>
@bd233 bd233 force-pushed the alibabacloud-recommitted branch from 3437897 to aa082c9 Compare November 3, 2021 15:58
@bd233
Copy link
Contributor Author

bd233 commented Nov 3, 2021

@bd233 @dongchen126

One simple update remaining to this file: https://github.com/openshift/installer/pull/5333/files#diff-d8695174d83d5a37969524935693f06fda5f8f2c947f3d979a7162dca4721f64R8

Should be:

	machineapi "github.com/openshift/api/machine/v1beta1"

Have updated

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 3, 2021

@bd233: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ovirt aa082c9 link false /test e2e-ovirt
ci/prow/okd-e2e-aws-upgrade aa082c9 link false /test okd-e2e-aws-upgrade
ci/prow/e2e-aws-workers-rhel7 aa082c9 link false /test e2e-aws-workers-rhel7
ci/prow/e2e-aws-workers-rhel8 aa082c9 link false /test e2e-aws-workers-rhel8
ci/prow/e2e-metal-ipi-ovn-ipv6 aa082c9 link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-crc aa082c9 link false /test e2e-crc

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kwoodson
Copy link

kwoodson commented Nov 3, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 3, 2021
@openshift-merge-robot openshift-merge-robot merged commit 55b897f into openshift:master Nov 3, 2021
@kwoodson
Copy link

kwoodson commented Nov 3, 2021

@bd233 @dongchen126 Congrats!

Please update #5348 so that we can finish that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants