functions icon indicating copy to clipboard operation
functions copied to clipboard

Is there a way to specify "latest" image version when registration a function?

Open sss0350 opened this issue 7 years ago • 4 comments

Hi there, Here's some trouble I encounter, We are developing some "functions" on iron, and we check in code to Git and use CI (jenkins) to build code and automatic push and register function to iron. This iteration will happen dozen of times during developing time, but I can't find a way to register version number like "latest" on iron. I have to delete docker images on node, every time after rebuilding our code (the same version number ex: 0.0.1). Or since there's a the same docker image file on registry , iron won't try to pull the latest one before trigger. Is there a better way to do this?

I try to change version to latest thru UI , I get error like this, Failed to pull image 'myfunctionxxxx:latest': manifest unknown: manifest unknown request_id: d7351dd2-e680-540b-bdd4-8f4ecdb88a32

sss0350 avatar Feb 21 '18 01:02 sss0350

you can specify docker image version using Iron Function's API. such like this : curl -ss -X PATCH --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"route":{"image":"DOCKER_IMAGE_URL:NEW_VERSION_NAME"}}' http://IRON_FUNCTION_SERVER:8080/v1/apps/APP_NAME/routes/ROUTE_NAME

so... simply call the Iron Function's API after build job finished.

If you want to check the current version of docker image, then call API like this : curl -ss http://IRON_FUNCTION_SERVER:8080/v1/apps/APP_NAME/routes/ROUTE_NAME

eugenegwon avatar Feb 21 '18 05:02 eugenegwon

Hi @eugenegwon,

Let me clarify a bit here , I know how to specify a "new" version number when route creating. And how to check docker image version.

The thing is , during developing period, we will build docker images again and again using the same version number (ex: 0.0.1) When local node already load this docker images, ( ex: test-imageName:0.0.1 ) it won't try to pull images again since it's already exist in this node repo. I know this is normal , but docker images actually can specify "latest" string as version number , to pull images if any update happened.

My question is , is there any similar way to let iron pull images "only" when images update. It seems I can't use "latest" as version number thru iron command or UI.

Thank you for help.

sss0350 avatar Feb 23 '18 16:02 sss0350

@sss0350 the normal work flow with IF, you bump the image version with fn bump when you want release a new image. this will iterate the version and also assign latest tag to it. Is there anything that is preventing you from using fn bump ?

c0ze avatar Feb 23 '18 22:02 c0ze

Thanks , I'll give a try. But local node will be occupied with lots of docker function images I think :0 Won't it be nice if we can specify latest as version number ?

sss0350 avatar Feb 24 '18 03:02 sss0350