Giter Club home page Giter Club logo

Comments (5)

flaper87 avatar flaper87 commented on July 2, 2024

Maybe I'm missing something here but it seems to me that the export command is doing the right thing:

def export(config: str, url: str):
"""Export a given config version from API server to a cloud bucket URL"""
conf = state.api.configs.get(config).body
cloud.export(conf, url, prnt=typer.echo)

It downloads the conf from the server L345 and then exports that conf to the destination bucket, which in the case of a local path is file:///bucket/....

Isn't this the expected behavior? According to the docstring it looks like it is.

That said, it does fail if the local bucket directory doesn't exist, I've created the /bucket dir manually and that seems to have solved the issue with the export when using file://. After running the command, I see the conf files in the bucket dir

DeepinScreenshot_select-area_20210220061302

from curiefense.

xavier-rbz avatar xavier-rbz commented on July 2, 2024

It is indeed doing what it says it does: the client obtains the configuration from the server, then exports it. If the cloud bucket is an s3 bucket, then the client will write there (fails if the client doesn't have credentials); if it is a local path, then the client will write there (fails if the local path does not exist).

What I suggest is that the "writing to cloud storage" part be done by the server rather than the client. That is, curieconfctl would request the server to export a config to a cloud bucket. The client would not write anything to the bucket: that would be done by the server.

from curiefense.

flaper87 avatar flaper87 commented on July 2, 2024

A-ha, thanks! Now I understand what you meant.

What do you think should be the right behavior when asking to export using local path? Should the server still export to a local path mounted in the server?

If I understand correctly the goal of the export command in this context, I'd say that the config should be exported locally (where curieconfctl is running).

Another option I was considering is to add a flag --local to the export command which indicates that the export has to be done by curieconfctl. If not passed, then the export will be done by the confserver. We can use the latter as the default behavior.

Thoughts?

from curiefense.

flaper87 avatar flaper87 commented on July 2, 2024

Alright, I looked at this in more detail. We already have a function/command to export configs remotely and it's publish.

After looking at the API, the CLI implementation, and curieconf.utils it looks like it does exactly what we want. However, using export as the command name is confusing. Not sure how many tools are depending on it but we could plan on renaming it.

Am I missing something?

from curiefense.

xavier-rbz avatar xavier-rbz commented on July 2, 2024

Indeed, tool publish does exactly what I needed. Thank you! #176 will fix this.

from curiefense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.