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

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

Open
sss0350 opened this issue Feb 21, 2018 · 4 comments

Comments

@sss0350
Copy link

sss0350 commented Feb 21, 2018

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

@eugenegwon
Copy link

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

@sss0350
Copy link
Author

sss0350 commented Feb 23, 2018

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.

@c0ze
Copy link
Contributor

c0ze commented Feb 23, 2018

@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 ?

@sss0350
Copy link
Author

sss0350 commented Feb 24, 2018

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants