Skip to content

[TypeSpec-Clean] Updates for OpenAi.Inference#23970

Merged
markcowl merged 1 commit intoAzure:mainfrom
markcowl:tsp-clean-oaiinf
May 13, 2023
Merged

[TypeSpec-Clean] Updates for OpenAi.Inference#23970
markcowl merged 1 commit intoAzure:mainfrom
markcowl:tsp-clean-oaiinf

Conversation

@markcowl
Copy link
Member

@markcowl markcowl commented May 12, 2023

@markcowl markcowl requested a review from yangyuan as a code owner May 12, 2023 22:24
@openapi-workflow-bot
Copy link

Hi, @markcowl Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?

  • Any feedback about review process or workflow bot, pls contact swagger and tools team. vscswagger@microsoft.com

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 12, 2023

    Swagger Validation Report

    ️️✔️BreakingChange succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️️✔️LintDiff succeeded [Detail] [Expand]
    Validation passes for LintDiff.
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
    ️️✔️~[Staging] ServiceAPIReadinessTest succeeded [Detail] [Expand]
    Validation passes for ServiceAPIReadinessTest.
    ️️✔️SwaggerAPIView succeeded [Detail] [Expand]
    ️️✔️CadlAPIView succeeded [Detail] [Expand]
    ️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PoliCheck succeeded [Detail] [Expand]
    Validation passed for PoliCheck.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    ️️✔️CadlValidation succeeded [Detail] [Expand]
    Validation passes for CadlValidation.
    ️❌TypeSpec Validation: 14 Errors, 5 Warnings failed [Detail]
    Rule Message
    import-not-found Couldn't resolve import "@azure-tools/typespec-client-generator-core"
    Location: specification/cognitiveservices/ContentSafety/routes.tsp#L2
    invalid-ref Namespace Azure doesn't have member ClientGenerator
    Location: specification/cognitiveservices/ContentSafety/routes.tsp#L12
    unknown-identifier Unknown identifier Cadl
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L9
    unknown-identifier Unknown identifier Cadl
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L10
    unknown-identifier Unknown identifier Cadl
    Location: specification/cognitiveservices/OpenAI.Authoring/finetune.tsp#L93
    unknown-decorator Unknown decorator
    Location: specification/cognitiveservices/OpenAI.Authoring/finetune.tsp#L93
    unknown-identifier Unknown identifier route
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L27
    unknown-decorator Unknown decorator
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L27
    unknown-identifier Unknown identifier get
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L28
    unknown-decorator Unknown decorator
    Location: specification/cognitiveservices/OpenAI.Authoring/model.routes.tsp#L28
    MissingExamplesDirectory "details":"The 'examples' directory is missing in the typespec folder specification/cognitiveservices/OpenAI.Authoring,
    please ensure the 'examples' is added in the PR."
    MissingExamplesDirectory "details":"The 'examples' directory is missing in the typespec folder specification/cognitiveservices/OpenAI.Inference,
    please ensure the 'examples' is added in the PR."
    SwaggerNotExistInPRBranch "details":"The generated swagger file 2022-12-01/openapi.json from typespec specification/cognitiveservices/OpenAI.Inference is not on the branch."
    SwaggerNotExistInPRBranch "details":"The generated swagger file 2023-03-15-preview/openapi.json from typespec specification/cognitiveservices/OpenAI.Inference is not on the branch."
    ⚠️ MissingTypeSpecProjectConfig "details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/cognitiveservices/AnomalyDetector,
    please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'."
    ⚠️ MissingTypeSpecProjectConfig "details":"The configuration 'output-file' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/cognitiveservices/OpenAI.Authoring,
    please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'."
    ⚠️ MissingTypeSpecProjectConfig "details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/cognitiveservices/OpenAI.Authoring,
    please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'."
    ⚠️ MissingTypeSpecProjectConfig "details":"The configuration 'output-file' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/cognitiveservices/OpenAI.Inference,
    please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'."
    ⚠️ MissingTypeSpecProjectConfig "details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/cognitiveservices/OpenAI.Inference,
    please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'."
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    Posted by Swagger Pipeline | How to fix these errors?

    @ghost ghost added the Cognitive Services label May 12, 2023
    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 12, 2023

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]
    ️️✔️SDK Breaking Change Tracking succeeded [Detail] [Expand]

    Breaking Changes Tracking

    ️❌ azure-sdk-for-net-track2 failed [Detail]
    • Code Generator Failed [Logs]Release - Generate from 18b397a. SDK Automation 14.0.0
      command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
      command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mException: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:133
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1mLine |
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m 133 | �[0m             �[36;1mthrow "Not provide service name or namespace."�[0m
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[36;1m     | �[31;1m             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[36;1m     | �[31;1mNot provide service name or namespace.
      cmderr	[Invoke-GenerateAndBuildV2.ps1] �[0m
      error	Script return with result [failed] code [1] signal [null] cwd [azure-sdk-for-net]: pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1
      warn	Skip package processing as generation is failed
    ️⚠️ azure-sdk-for-java warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from 18b397a. SDK Automation 14.0.0
      command	./eng/mgmt/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.1.2
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.1.2
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
      warn	No file changes detected after generation
      warn	No package detected after generation
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 12, 2023

    Generated ApiView

    Language Package Name ApiView Link
    TypeSpec OpenAI.Inference https://apiview.dev/Assemblies/Review/d04cfc0d8c8e4f8f94f23aa04753ca73

    - "@azure-tools/typespec-autorest"
    - "@azure-tools/cadl-apiview"
    # - "@azure-tools/typespec-autorest"
    # - "@azure-tools/cadl-apiview"
    Copy link
    Member

    Choose a reason for hiding this comment

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

    There is currently no config for typespec-autorest, so I don't think it will output any swagger? Once we add config, should it output to this folder?

    https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    If this started with a new api-version, that would be the case. As it is, this older api-version is very unlikely to match the swagger in that folder (though it would hopefully be sematically equivalent)

    Copy link
    Member

    Choose a reason for hiding this comment

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

    This change causes the CI pipeline to "pass", but it's only because no emitter is run:

    + pushd specification/cognitiveservices/OpenAI.Inference
    + npx tsp compile .
    TypeSpec compiler v0.43.0
    
    Diagnostics were reported during compilation:
    
    warning emitter-not-found: Emitter with name @azure-tools/typespec-csharp is not found.
    warning emitter-not-found: Emitter with name @azure-tools/typespec-java is not found.
    
    Found 2 warnings.
    
    No emitter was configured, no output was generated. Use `--emit <emitterName>` to pick emitter or specify it in the typespec config.
    

    Do we want specs in the repo with no emitters configured? What is the scenario for this?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    It looks like this is here purely for client generation. If we can agree on where to emit the swagger, it would be good to emit it there

    Copy link
    Member

    Choose a reason for hiding this comment

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

    I'm fine merging this PR as-is. Later we will need to decide what to do with specs that are client-only (don't emit swagger).

    - "@azure-tools/typespec-autorest"
    - "@azure-tools/cadl-apiview"
    # - "@azure-tools/typespec-autorest"
    # - "@azure-tools/cadl-apiview"
    Copy link
    Member

    Choose a reason for hiding this comment

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

    This change causes the CI pipeline to "pass", but it's only because no emitter is run:

    + pushd specification/cognitiveservices/OpenAI.Inference
    + npx tsp compile .
    TypeSpec compiler v0.43.0
    
    Diagnostics were reported during compilation:
    
    warning emitter-not-found: Emitter with name @azure-tools/typespec-csharp is not found.
    warning emitter-not-found: Emitter with name @azure-tools/typespec-java is not found.
    
    Found 2 warnings.
    
    No emitter was configured, no output was generated. Use `--emit <emitterName>` to pick emitter or specify it in the typespec config.
    

    Do we want specs in the repo with no emitters configured? What is the scenario for this?

    @markcowl markcowl merged commit 18b397a into Azure:main May 13, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants