Getting Provisioning failed for CloudFormation when creating a project in SageMaker studio - amazon-sagemaker

I am testing out MLOps using SageMaker studio and am creating a project using a template for MLOps provided by SageMaker: MLOps template for model building, training, and deployment with third-party Git repositories using CodePipeline
I am getting this error when creating the project
Your project couldn't be created
Studio encountered an error when creating your project. Try recreating the project again.
Client error: Provisioning failed with error: Errors from CloudFormation: [{LogicalResourceId : SC-493356053890-pp-khphda3aqa5qq, ResourceType : AWS::CloudFormation::Stack,
StatusReason : The following resource(s) failed to create: [SageMakerModelDeploySeedCodeCheckinProjectTriggerLambdaInvoker, SageMakerModelBuildSeedCodeCheckinProjectTriggerLambdaInvoker]. Rollback requested by user.},
{LogicalResourceId : SageMakerModelBuildSeedCodeCheckinProjectTriggerLambdaInvoker, ResourceType : AWS::CloudFormation::CustomResource, StatusReason : Resource creation cancelled}, {LogicalResourceId : SageMakerModelDeploySeedCodeCheckinProjectTriggerLambdaInvoker, ResourceType : AWS::CloudFormation::CustomResource,
StatusReason : Received response status [FAILED] from custom resource. Message returned: Codebuild to checkin seedcode has status FAILED (RequestId: ab735779-d179-4714-af64-f0e17b5b671b)},
{LogicalResourceId : SageMakerModelDeploySeedCodeCheckinProjectTriggerLambdaInvoker, ResourceType : AWS::CloudFormation::CustomResource, StatusReason : Resource creation Initiated}, {LogicalResourceId : SageMakerModelPipelineBuildProject, ResourceType : AWS::CodeBuild::Project, StatusReason : Resource creation Initiated}, {LogicalResourceId : ModelDeployBuildProject, ResourceType : AWS::CodeBuild::Project, StatusReason : Resource creation Initiated}, {LogicalResourceId : GitSeedCodeCheckinProjectTriggerLambda, ResourceType : AWS::Lambda::Function, StatusReason : Resource creation Initiated}, {LogicalResourceId : GitSeedCodeCheckinProject, ResourceType : AWS::CodeBuild::Project, StatusReason : Resource creation Initiated}, {LogicalResourceId : ModelBuildSagemakerCodeRepository, ResourceType : AWS::SageMaker::CodeRepository, StatusReason : Resource creation Initiated}, {LogicalResourceId : ModelDeploySagemakerCodeRepository, ResourceType : AWS::SageMaker::CodeRepository, StatusReason : Resource creation Initiated}, {LogicalResourceId : MlOpsArtifactsBucket, ResourceType : AWS::S3::Bucket, StatusReason : Resource creation Initiated}, {LogicalResourceId : ModelDeployTestProject, ResourceType : AWS::CodeBuild::Project, StatusReason : Resource creation Initiated}, {LogicalResourceId : WaitHandle, ResourceType : AWS::CloudFormation::WaitConditionHandle, StatusReason : Resource creation Initiated}, {LogicalResourceId : SC-493356053890-pp-khphda3aqa5qq, ResourceType : AWS::CloudFormation::Stack, StatusReason : User Initiated}].
The IAM role attached to the SageMaker studio has the following policies attached
{
"AttachedPolicies": [
{
"PolicyName": "AWSCodePipelineFullAccess",
"PolicyArn": "arn:aws:iam::aws:policy/AWSCodePipelineFullAccess"
},
{
"PolicyName": "AmazonSageMakerFullAccess",
"PolicyArn": "arn:aws:iam::aws:policy/AmazonSageMakerFullAccess"
},
{
"PolicyName": "AmazonSageMaker-ExecutionPolicy-20211020T164534",
"PolicyArn": "arn:aws:iam::493356053890:policy/service-role/AmazonSageMaker-ExecutionPolicy-20211020T164534"
},
{
"PolicyName": "ECR_FullAccess",
"PolicyArn": "arn:aws:iam::493356053890:policy/ECR_FullAccess"
},
{
"PolicyName": "AmazonSageMakerServiceCatalogProductsUseRole-20211029T121670",
"PolicyArn": "arn:aws:iam::493356053890:policy/service-role/AmazonSageMakerServiceCatalogProductsUseRole-20211029T121670"
},
{
"PolicyName": "SagemakerDomainKeyAccess-asp",
"PolicyArn": "arn:aws:iam::493356053890:policy/SagemakerDomainKeyAccess-asp"
},
{
"PolicyName": "AWSLambda_FullAccess",
"PolicyArn": "arn:aws:iam::aws:policy/AWSLambda_FullAccess"
}
]
}
When creating a new project I pass,
The URLs to the training and deployment git repositories
Respective username/repositoryname
ARN of the CodeStar connection to GitHub with a tag sagemaker=true (access to all the repos in my account)
What am I missing here?

Related

Problem creating a Salesforce User via SCIMv2 when specifying ContactId

I am using the Salesforce REST APIs to create a Contact and then an associated User. If I allow the creation of a User (via SCIMv2) to create an Account and Contact automatically (as details at link), the creation works. Unfortunately, I need to populate a custom field in the Contact and must create it separately.
The link also states that I can include the AccountId and ContactId to prevent the auto-creation. To do this I include the specified Account and Contact in the SCIMv2 JSON as shown below.
{
"schemas" : [ "urn:ietf:params:scim:schemas:core:2.0:User", "urn:salesforce:schemas:extension:external:2.0", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" ],
"userName" : "fred.bloggs#example.com",
"name" : {
"familyName" : "Bloggs",
"givenName" : "Fred"
},
"emails" : [ {
"type" : "work",
"primary" : true,
"value" : "fred.bloggs#example.com"
} ],
"preferredLanguage" : "en_US",
"locale" : "en_AU",
"timezone" : "Australia/Hobart",
"active" : true,
"entitlements" : [ {
"value" : "00e5j000000md3VAAQ"
} ],
"urn:salesforce:schemas:extension:external:2.0" : {
"contactId" : "0039D00000JBLfvQAH",
"accountId" : "0019D00000OkFMYQA3"
}
}
When I make this request I get an error response from Salesforce:
Response Status:400 - Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate record. We recommend you use an existing record instead.
Since there is definitely not a User object already in the system for this user, I am assuming it's trying to create the Contact again and failing.
Any help to understand what is happening and what I am doing wrong would be appreciated.

Why is my Model.find().fetch() returning data from Mongodb on the server side but then returning [ ] on the client in Meteor?

I have added console logs in the schema file, and retrieved data from the database by running meteor mongo :
{ "_id" : ObjectId("5f0d8af2b08fc89eadef0dd1"), "title" : "Hello world!" }
{ "_id" : ObjectId("5f0d8af9b08fc89eadef0dd2"), "title" : "Hello world!s" }
{ "_id" : ObjectId("5f0d9449b08fc89eadef0dd3"), "title" : "Hello world!s" }
{ "_id" : ObjectId("5f0f2d7eb08fc89eadef0dd4"), "title" : "Task1" }
and still, the same data is retrieved via the server-side through a console log I added on the subscription function:
Schema.js
if (Meteor.isServer) {
Meteor.publish('tasks', function task() {
console.log(Tasks.find({}).fetch(),' ttttttttttttttttttttttt');
return Tasks.find({}).fetch();
});
}
Then when I try to return the same data in another file, it actually fails to return the data and instead returns this in the console:
[] "These are the results"
Get.js
const getAllTasks=()=>{
sub=Meteor.subscribe('tasks').ready();
const tasks = Tasks.find({}).fetch();
console.log(tasks, 'These are the results');
return tasks
}
Here's my file structure
Question
Please help me figure out what I am potentially doing wrong?
Are you exposing the pub to your client? Download meteor dev tools (I know this is on chrome but not sure of other browsers) and you can see which publications are reaching your client and what in your db the client has access to.

How to create an Azure Search indexer using the REST API

Due to a bug in the Azure portal, I am needing to create an Azure Cognitive Search data source, index, and indexer programmatically using the REST API. There were no issues creating the data source or index, but the POST request below returns the following error.
{
"error": {
"code": "",
"message": "The request is invalid. Details: dataSource : A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.\r\n"
}
}
The following POST request is a modified example found on this page, with the variables replaced with the correct names of the service-name, admin-key, dataSourceName and targetIndexName.
POST request (using postman)
POST https://SERVICENAME.search.windows.net/indexers?api-version=2019-05-06
Content-Type: application/json
api-key: ADMINKEY
{
"name" : "my-json-indexer",
"dataSourceName" : "BLOBDATASOURCE",
"targetIndexName" : "TARGETINDEX",
"schedule" : { "interval" : "PT2H" },
"parameters" : { "configuration" : { "parsingMode" : "json" } }
}
Seems that when you've created your data source, the type property was not provided.
Here's the two requests:
Create data source
POST https://[service name].search.windows.net/datasources?api-version=2019-05-06
Content-Type: application/json
api-key: [admin key for Azure Cognitive Search]
{
"name" : "my-blob-datasource",
"type" : "azureblob",
"credentials" : { "connectionString" : "DefaultEndpointsProtocol=https;AccountName=<account name>;AccountKey=<account key>;" },
"container" : { "name" : "my-container", "query" : "optional, my-folder" }
}
Create indexer
POST https://[service name].search.windows.net/indexers?api-version=2019-05-06
Content-Type: application/json
api-key: [admin key for Azure Cognitive Search]
{
"name" : "my-json-indexer",
"dataSourceName" : "my-blob-datasource",
"targetIndexName" : "my-target-index",
"schedule" : { "interval" : "PT2H" },
"parameters" : { "configuration" : { "parsingMode" : "json" } },
"fieldMappings" : [
{ "sourceFieldName" : "/article/text", "targetFieldName" : "text" },
{ "sourceFieldName" : "/article/datePublished", "targetFieldName" : "date" },
{ "sourceFieldName" : "/article/tags", "targetFieldName" : "tags" }
]
}

SalesForce Chatter Rest API - Can not set CreatedDate

I want to set the createdDate for a new feed-element (via SalesForce Rest API).
I tried to do this:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "When should we meet for release planning? "
}]
},
"feedElementType" : "FeedItem",
"subjectId" : "0060Y00000XYZXYZ",
"createdDate ": "2016-10-27T08:01:56.000Z"
}
But I get this error message:
[
{
"errorCode": "JSON_PARSER_ERROR",
"message": "Unrecognized field \"createdDate \" at [line:-1, column:-1]"
}
]
I read that I can set the createdDate via API (https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_feed_element.htm), but I don't find a example or a way to do this.
Also I tried to set the createdDate in a update request, but the same result.
I hope someone can help me. Thanks!

Access fileObj storeName or key collectionFS

How can I get in a call back after inserting a file using collectionFS the key value?
Images.insert(file, function (err, fileObj) {
if (err) {
console.log(err);
} else {
console.log('success', fileObj);
setTimeout(function () {
console.log('url', fileObj.url());
let url = fileObj.url('images');
$scope.slideshows.url = `${url}`
$scope.$apply();
}, 2000);
}
});
I'm building a cms which handles file uploads to show in different apps, I'm able to see the uploaded file using {{image.url}} in the cms but I'm unable to view the images uploaded using this method in the other apps.
Every app is connecting to the same database and I'm uploading the images into my server using:
Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: '/home/uploadedimages'})]
});
I'm then using nginx to serve those images so I can access them via http://domain.com/uploadedimages.
In order to fix my problem I need to somehow get the key value in this schema stored by collectionFS:
{
"_id" : "5BEe4maLCMFtHAZAj",
"original" : {
"name" : "wantedposter.jpg",
"updatedAt" : ISODate("2016-05-19T13:34:32.050Z"),
"size" : 28828,
"type" : "image/jpeg"
},
"uploadedAt" : ISODate("2016-05-19T21:30:54.299Z"),
"copies" : {
"images" : {
"name" : "wantedposter.jpg",
"type" : "image/jpeg",
"size" : 28828,
"key" : "images-5BEe4maLCMFtHAZAj-wantedposter.jpg",
"updatedAt" : ISODate("2016-05-19T21:30:54Z"),
"createdAt" : ISODate("2016-05-19T21:30:54Z")
}
}
}
So I can do /uploadedimages/:key
QUESTION
Is there a way to get the key value from collectionFS?

Resources