Uploading content into Azure

i am trying to upload my vectara-answers app into my azure account, i have managed to upload all of the content in the .env file in the configuration section, but i cannot seem to figure out how to get the queries.json file into azure. does anyone have any suggestions?
the questions that i want run for me locally, just not on azure.

Hi @Hibaq_A

Are you running this using the docker container?

We have more detailed instructions on docker-hub that demonstrate this (and you can also notice this in the run.sh file), but please notice that when running the docker container, the script uses two external files:

  1. the .env file with: “–env-file .env”
  2. the queries file using the Docker volume option: -v $(PWD)/queries.json:/usr/src/app/build/queries.json

Specifically for the queries, this maps the local queries.json into the /usr/src/app/build/queries.json folder in the docker space.

Can you please provide more details about how you run this in the Azure environment?

In my run.sh there is a line that has queries.json:/usr/src/app/build/queries.json, but whenever I tried to run the docker command, it says file not found. I don’t know where that path is supposed to be. I did all the steps in the get-hub instructions and I uploaded all of the content of the .env file as application settings and everything works except the queries.json, but again, my questions appear locally just not on Azure. Also, to answer your question, I have made a docker image and a container registry. I just wanted to add, when I cloned the repository, I could not find config/vectara-website-search/ so I duplicated the folder website-vectara, was that the right folder? Second, my secrets.toml does not look like this;

$ cat secrets.toml
[news]
    api_key="zwt_YZD..."
[finance]
    api_key="zwt_YOQ..."

But instead, looks like this:

[default]
api_key=“…vectara-api-key…”

Also, my config.yaml does not look like this:

$ cat config.yaml
corpus_id: "151,152,153,154,155"
customer_id: 1526022105

app_title: "AskNews"
app_header_learn_more_link: "https://vectara.com/developers/sample-apps/"
search_description: "Sample news aggregator built using Vectara"
search_logo_src: "images/asknews_logo.png" ## could be URL
search_logo_alt: "AskNews logo"
search_logo_height: "20"

enable_source_filters: True
sources: "BBC,NPR,FOX,CNBC,CNN"

Instead, it looks like this:

corpus_id: 2

customer_id: 1169579801

search_title: “Vectara website search”

enable_source_filters: False

source: “”

summary_default_language: “eng”

summary_num_sentences: 3

summary_num_results: 7

Lastly, my queries.json does not look like this:

$ cat queries.json
{
    "questions": [
        "Should AI be regulated?",
        "Will AI replace Hollywood screenwriters?",
        "Should athletes be allowed to protest?",
        "what happened to Harry and Megan in NYC?"
    ]
}

Instead, it looks like this:

{
“questions”: [
“what is grounded generation?”,
“how do I index a document?”,
“what does Vectara do?”,
“who is Amr?”
]
}

I have used the info from the example as to not show my private information.

Thanks @Hibaq_A
All the setup looks okay; my suspicion is that Azure takes the docker container from the Azure registry and as you say above you can upload the application settings to Azure (from .env) but the Azure setup does not know how to upload the queries.

Perhaps we can try a workaround here: the queries.json file needs to be in the folder /usr/src/app/build inside the docker container. That means you probably adjust the “Dockerfile” to copy it permanently to there when building the docker image. (by default it’s built not to do this, but “map” the file, so that it’s more easily changeable, and we don’t have to recreate the whole docker image for each change in queries.)

Can you please try the following: after the 3 lines in the Dockerfile

COPY public ./public
COPY img ./img
COPY build ./build

Add the following

COPY /path/to/queries.json ./build

(where /path/to/queries.json is the path to where you local queries.json file is).

Then rebuild the docker image, and upload this new one into the docker registry.
Please let me know if this works.

I got this message when I inputted the run command with the changes you suggested. Should I still go ahead with uploading the docker image to the registry?
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 61e0cfa2-f95f-4f9e-90a8-8f16eddaa77b::ugudk6z1opeuhabbmfnnz1tqn: “/path/to/queries.json”: not found
vanswer
ac0493c8a704e35e270700ecbd85cf9f27c48498a6184259aef69546d3c2f7de
Success! Application is running at http://localhost:80.\nTo shut it down use: docker container stop vanswer.

Sorry, I meant for you to change “/path/to/queries.json” to the actual path in your local computer (where you build the Docker image) of the queries.json file you are trying to use (that worked locally). Does that make sense?

I did that and unfortunately it still did not work.

Hibaq Abdi
MSW, RSW, BSW, OCGC(MKM), BA(MIT)

okay sorry about that - maybe we can hop on a quick zoom call tomorrow?
Let me know if that works and what times may work for you

Tomorrow would be perfect. I am free anytime so please let me know what works best for you.

Hibaq Abdi
MSW, RSW, BSW, OCGC(MKM), BA(MIT)

How about 10am or 11am pst?
Pls share your email address and I can send invite

Thanks,
Ofer

11am PST works for me. Here is my email:

froshability@gmail.com

Hibaq Abdi
MSW, RSW, BSW, OCGC(MKM), BA(MIT)

Are we still meeting at 11am PST? I haven’t received a zoom link

Hibaq Abdi
MSW, RSW, BSW, OCGC(MKM), BA(MIT)

Yes, sorry just resent. Did you get it now?